> TinyPNG
If you don't want to use their website or API, or you want to do compression without going over the network, they use pngquant internally so you can also just use the tool directly. https://pngquant.org/
I was ready to put on my pedant glasses and lecture you about PNG always being lossless...
...but what do you know, there indeed are lossy compressors for PNG. TIL - not something many people will want, but as a web dev, bookmarked for the next time a client wishes to have a huge alpha-transparent image on a web page, despite me objecting it strongly. Still, 99% percent of the time when discussing PNGs, we are talking about lossless compression. Which I think is what the GP meant.
There are also programs that can "destroy" a PNG image to make it better fit the lossless png compression algorithm. Essentially generating a lossy png. One such tool is https://pngquant.org/
But i have to say, the artefacts in the images looks more like it comes from jpg.
I use pngquant myself. There's the PNGoo batch program that works really well. I've been able to compress my files a bit more than just 60% average. Of course it depends on the amount of different colors in your image. But I've had images range between 15-30% of the original files.
> 200px tall header image that has gobbled 160kb of traffic
Goodbye, /r/metalgearsolid, I'm not opening you again.
Oh, and it's actually 400px until actual content. Browsing that on a laptop with 768px tall screen is fun!
Edit: they didn't even bother optimizing it. Their 160kb header is easily compressible to 60kb simply by running it through pngquant.
Edit 2: messaged the mods of that sub and provided links to a compressed header image as well as a web frontend to pngquant
I've noticed a major difference in file size when using "Save As..." as opposed to "Save for web." Not sure why. (Maybe alpha mask?)
I now only use 'Save for Web', to optimise file size.
Not sure if that helps....?
PS: I also use PngQuant if size is an issue.
if you have a 24 or 32-bit png, and you want to reduce it's size drastically by reducing the number of colors in it, you can use a tool like pngquant to reduce the number of colors to any power of 2 between 2 and 256, with or without dithering. For images that don't actually use many colors, this can potentially reduce their filesize drastically with minimal or no impact on quality. If the images do contain many colors, quality will be impacted, but dithering can mitigate issues such as banding.
What software are you using to create the ebook? Scrivener? Something else?
And what are you using to check the ebook?
If night/day mode is something your ereader software does (iBooks?) I'm guessing it just switches the text background/foreground colors.
If you have a black image with a transparent background, then the whole thing is going to look black when it's placed on a page with a background of rgb(0,0,0).
An image with a white (not transparent) background should display correctly, but it would look a bit startling on a black page.
The PNG format allows for variable opacity, so in theory you could take a white background in your image and give it 50% opacity, but Photoshop and GIMP (and most likely Illustrator) don't support it well.
There is a tool called pngquant that can help.
> Written in C++ programming language (with C, HTML, JavaScript) which can be optimized efficiently on any operating system. The best example is how Microsoft Edge is compiled and optimized for Windows so that it is more efficient than Google Chrome. Do not mix with other programming languages which can lead to inefficiency and new bugs (Rust, Python, ...).
Worth a read: https://pngquant.org/rust.html
Make the images the size that they're displayed on screen.
Compress JPGs via Photoshop. For PNGs, I run them through PNGoo - I got your friends-blob down to 144kb (from 4,100kb)
checking out your screenshot now.
One of my sites generates a lot of PNG images so I installed https://pngquant.org/ and run all generated PNGs (except the print versions) through it and it allows me to have 3 times as many images for the same storage.
Try https://imageoptim.com if you have a Mac.
Without going too much into the technical details, it uses the same pngquant library as TinyPNG but can produce smaller images by using different compression levels and techniques.
It sounds like you have a target of 800Kb so experiment with various resolutions and compression levels. Don't be deadset on a resolution size unless there is a technical requirement, so try 1600px or other sizes as alternatives until you have something that works.
Like PNGs? I've used those with no discernable loss in quality for my POV.
However, it uses <code>pngquant</code> for lossy PNG compression, so I could see it happening. Probably not to a point where you'd notice in the end-result avatar unless you had heavy use of big gradients, maybe?
You can do a lossy compression of an image before exporting to the PNG format, but the PNG format and native compression is lossless, by design.
https://en.wikipedia.org/wiki/Portable_Network_Graphics#Compression
Here's my newest edit!
By the way, if you're making edits, I would suggest running something like pngquant to reduce the file size (you can also use pngcrush to do it losslessly, albeit with a higher filesize) by reducing the color palette used by the PNG. These comics have a simple style with few colors, so you can easy set it to 256 or 128 colors and have it look pretty much exactly the same (I got greedy here and used 64 colors, so you can probably see a bit of dithering, but at 128 it'll look fine)
I would very much recommend doing something like this, since pngquant can easily cut the file size in half for these comics
tinyPNG is great, but requires a bit of manual work to drag and drop from their website for the free version and is limited to 500 images if you register. There's a paid version, but I'm not about to pay.
If you want to go the route of lossy (e.g. 256 colors), tinyPNG is supposedly based on PNGNQ, but I like PNGQUANT (https://pngquant.org) since it is ported to multiple platforms and there's a Windows GUI version for batch conversion, called PNGoo on the same page.
Yeah, I know, lots of PNG prefixed program names.
I might go the lossy PNG route, but at this time, I would rather have hakchi2 integrate some PNG art compression (lossy or lossless) right before sync'ing with the NESC. This would make things easier for people who are not that great with activities like this, nor care that much.
Someone else pointed this out above with TinyPNG, but the same is true for Kraken.io
>If you don't want to use their website or API, or you want to do compression without going over the network, they use pngquant internally so you can also just use the tool directly. https://pngquant.org/