I am developing a mobile app on flutter. The app will use about 10 thousand images that are loaded from server and cached. Every image now has about 600x400 resolution, jpeg extension, and size about 100Kb. So the total size will be about 1Gb and I have the following questions:
1) Is there a way to reduce the total size? What image format should I use? Should I compress it on server side and decompress in app if images are loaded one by one?
2) What is the best way to choose image resolution so that the app looks good on both the phone and the tablet?
I won't advice you putting a lot of tasks onto the server side.
The server should be doing the fetching stuffs,
I would suggest you to
Enforce compressions on the client which uploads the image to the server
Pass the images to a third party compressor before they reach your mobile client
The images are of jpeg format, these are easily resized.
This site can help you with the compression..
But I still emphasize you to do it yourself on the client who uploads the image
Related
I have compressed my images from 80-300 kbs back to 4-12 kbs in https://tinypng.com/ and replaced them in the joomla library (3.6.5), they keep the same size when inside the library, but when downloading from the front-end they are back to their original size.
The tool https://developers.google.com/speed/pagespeed/insights still gives the same message that my images are too big and show the new compressed images with their old sizes.
What did I do wrong?
If Google's PageSpeed tool didn't show the same old images, it might have been a local caching problem. However, since it shows the bigger file sizes, that can be eliminated as possible cause.
Therefore: Your server still has the old (uncompressed) images. Your error was with the upload / replacing of those images.
A bit of background to find the root cause: Unlike some other CMS systems, Joomla does not touch the images when serving a page. They are stored on your webserver exactly as served to the client, and are served by Apache (or whatever other webserver you might be running). You can use an FTP client to check the file sizes directly.
I have project to create elearning website using joomla and there are videos and many images in my site .i used hypervisor as server with Specification Processor : 1 Core Intel Xeon E5640 , Memory: 4 GB , when 50 user accessed my site , the loading page was too slow. any recomendation server for my site?
It won't necessarily be your server. Unless you have taken the appropriate steps to reduce images and videos they could be reduced by 70%, this will instantly speed things up
check out the following
Tiny Jpg
Tiny Png
Also google how to reduce video size.
Look at a CDN (cross distribution network) to serve your content locally
Also Sprite maps and optimization for repeated elements like Buttons etc.
Use CSS to replace things like buttons.
I'm developing a project using CakePHP 3 for server side and Android for client side. In this project I have to send a lot of images of products from the server to the app. When the app requests the images of a product, the server searches in the database for the urls of the images and send them to the app through a json response. Then, in the app I load the images using NetworkImageView from Volley library.
This process works, but the images are heavy in size, so it consumes a lot of data if you use mobile network like 4g. I can't to lose image quality, so I can't treat the images too much.
What I was thinking was to compress (somehow) the images in server side, send the array of bytes through json and uncompress them in the app, so I could minimize data consumption.
I coudn't find any info for what I described above and I'm not sure if this is the right aproach. Any help would be appreciated.
What I was thinking was to compress (somehow) the images in server side, send the array of bytes through json and uncompress them in the app, so I could minimize data consumption.
JSON will increase and not lower the amount of data that needs to be send for obvious reasons. It's an envelope in your use case and the way JSON works it will add more data. Check the JSON spec.
You want to enable gzip compression on your Webserver (Nginx here), check Google for that or superuser.com for more details.
But this won't make a dramatic difference either for mobile use when you send a 20mpx image. I would send small images and only send a lager version when needed, when the user zooms in. Guess that's doable.
I have a website which is also a social media networking website where user can upload profile, cover & article picture.
So currently there are around 25000+ Images available many of them are even 2 MB- 10 MB large, so i want to compress them all at once.
Is that possible if yes then please specify how i can do that, because currently i'm using huge band-witch and also site is pretty slow.
Thanks!
What techniques do people commonly use for uploading, storing and presenting images with a CMS?
Do you store them in the database or on the file system?
Do you generate thumbnails on upload? Or on the fly, then maybe cache them for reuse? Or rely on browser scaling?
Typically, most content management systems will store images the actual data of image uploads to the file systems and then add a link to the file within the database. Thumbnails can either be generated on upload or on first request (on the fly is considered inefficient, especially given the cheap cost of storage). Browser scaling is a bad idea (images may be uploaded as multi megabyte uncompressed files) but is done by some systems.
i agree with kevin. i can't think of any cms that doesn't store in the file system. then only issue that comes up with that technique is if you are planning on clustering multiple web servers to run your cms. if thats the case then you have to plan on it and have the ability to point all the web servers to the same file storage location.
the technique ive used for years is on upload, resize the image to something practical for the web, then generate the thumbnail, then write them to the file system and record the pointer in the database.
if the site is a huge site then you need serve the images from cache servers because file systems are very slow in comparison to network IO. take facebook for example, they have billions of images on their site and last i heard 80% were held in cache servers around the world in ram. the file storage array they have is more or less a backup to the cache servers.