Closed DeeDeeG closed 7 years ago
Each of these increases in size by a factor of 4. The splash page load times aren't great already. It'd be nice to go the other direction in download size since the image resolution isn't critical to the application.
I did think the filesizes were a bit large, so I made compressed versions of the assets. Not on GitHub anywhere yet (Edit: they are in the comment below now!), here are some numbers for how the original assets compare with the new compressed ones:
city-photo.jpg
city-photo-2x.jpg
city-photo-3x.jpg
Edit: Adding some explanation of how this was done:
I noticed that city-photo-3x.jpg is a high-quality photo, probably straight from the camera SD card. This makes it easy to create high-quality smaller assets from it, by rescaling in GIMP. I then saved these out at 100% quality, to preserve all detail. Last, I ran through a variety of iterations of Mozjpeg (https://github.com/Mozilla/Mozjpeg) , to make sure they would compress efficiently.
I did subjective quality tests (I flipped back and forth in Firefox, zoomed in on details and stuff, mainly comparing against two compression quality levels I was deciding between, and also comparing against the original) to make sure the new images were as good as or better than the originals. My main strategy to keep the new images "better-looking" was to give them higher-resolution, but be willing to push compression to moderate levels, aiming to stop compressing right when artifacts became detectable, or when I felt they degraded subtle details of the image, when zoomed in.
I did also have file sizes in mind when doing this. (There are other ways of doing this, with only filesize as the main goal, and even lower filesizes could be achieved. There are diminishing returns, so I did want to try for a small win in visual quality at the same time as reducing filesize.)
Lastly, Mozjpeg includes a utility to find and remove extra data that doesn't affect the visuals (somehow??) and I ran this on each file as a last step, to save 1-5% more of the filesize.
/explanation
I would like to upload at minimum the new city-photo.jpg for your consideration, and perhaps we can also activate the 2x image if we are still being moderately conservative. Of course, I leave the call to activate them at all to the core maintainers.
Lets go ahead and upload the compressed versions. I'm fine with that.
Full disclosure: I learned how to compress jpegs for the first time working on this. I found out afterward that I had been doing a compression technique that can add little bits of noise, like on the dome (see below):
It's to the point where I think some of the originals are nicer-looking. I'd like to try to see what I can get without using that noise-inducing technique, and still using compression. Might get better results.
I can...
Before:
After:
try re-working them, and then finish this PR with the best ones, commit these as-is, merge, then do the re-work in a separate PR, Just go with these as-is and be done.
I'll trust your opinion on how they look to you. If you think this is ready to merge, I'm happy to go ahead and do that.
Open to any opinions on these of course, but they're small, and look pretty nice. I'm pretty happy with them now.
Thanks for waiting!
Devices with standard "1x" density will still get the less-detailed image.
Right now only city-photo.jpg (the splash page image) has high-res alternate versions.
Context
Summary of Changes
Checklist
Screenshots
Before
After