Jump to content

Hi,

i have to compress a large quantity of PNG files for a website, which only takes PNG with less than 6MB. The original files are in the range of 10-30MB so i have to compress them quiet a bit. I have tried PNGGauntlet with PNGOUT and OptiPNG (7) an it took a really long time (CPU 2200G; 3,8GHz; usage 20%).

 

Is there a GPU compression tool using OpenGL or CUDA? Or an other alternativ?

 

Link to comment
https://linustechtips.com/topic/1394853-fast-png-compression/
Share on other sites

Link to post
Share on other sites

I would launch multiple copies of Irfanview and do batch conversion on different folders in parallel ... as compression to png is single threaded , you'd probably get the best results with 6-8 threads in parallel. 

 

There are applications that do conversions using multiple threads, one was/is even used as a benchmark tool but I don't remember the tool now. 

 

Those tools like pngout and optipng only help you if you have particular images that don't use a lot of unique colors or large areas with same colors. Otherwise, they don't reduce the png image size in a significant enough way. 

 

I would batch convert them once using PNG's compressor at level 9 compression, and then select all the files that are still above your 6 MB threshold and consider more drastic measures, like resizing the image to 75% of original size, or 50% of original size 

 

A 30 MB PNG picture would have to be around 40-60 MB uncompressed ... that's enough for a 8K picture or even bigger... don't tell me you'd actually need that big of a picture. 

If they're scans of papers or stuff like that, maybe consider lowering the color depth to 16 bit (65k unique colors) or even 256 unique colors - it would still retain the color of the paper and the printed text with 256 unique colors.

 

 

Link to comment
https://linustechtips.com/topic/1394853-fast-png-compression/#findComment-15147793
Share on other sites

Link to post
Share on other sites

PNG is a lossless format. It employs compression itself to encode all the data as efficiently as possible, but that also means you're not going to get much of a size reduction without an accompanying reduction in colors and/or quality. A 6MB PNG is already physically large, though, so your best bet would most likely be to resize them to a more appropriate size for the application.

CPU: AMD Ryzen 9 9950X3D · Cooler: Noctua NH-D15S Chromax.black · Motherboard: Gigabyte Auros X670 Elite AX · RAM: G.Skill Flare X5 64GB (2 x 32GB) DDR5 6000MHz CL30 · Graphics Card: Zotac NVIDIA GeForce RTX 4070 Super Twin Edge OC 12GB · Boot Drive: 1TB XPG Gammix S70 Blade NVMe SSD · Game Drive: 2TB WD SN850X NVMe SSD · PSU: Seasonic Focus GX V3 1000W 80+ Gold · Case: Fractal Design North Mesh · Monitor: MSI Optix MAG342CQR 34” UWQHD 3440x1440 144Hz · Keyboard: EPOMAKER x Aula F99 Wireless Mechanical Keyboard · Mouse: Logitech G309 Lightspeed Wireless Gaming Mouse

Link to comment
https://linustechtips.com/topic/1394853-fast-png-compression/#findComment-15147802
Share on other sites

Link to post
Share on other sites

13 hours ago, mariushm said:

A 30 MB PNG picture would have to be around 40-60 MB uncompressed ... that's enough for a 8K picture or even bigger... don't tell me you'd actually need that big of a picture. 

If they're scans of papers or stuff like that, maybe consider lowering the color depth to 16 bit (65k unique colors) or even 256 unique colors - it would still retain the color of the paper and the printed text with 256 unique colors.

 

 

That's not how PNGs work. It's a lossless format and the complexity of the image completely dictates the size. I just finished an 8 bit, 4K sRGB landscape photo that ends up at 34MB after exporting to PNG.

 

A recent logo I made sits at 2.8MB at 10000x10000 when I export it as a PNG... It all depends on the content of the image.

MacBook Pro 16 i9-9980HK - Radeon Pro 5500m 8GB - 32GB DDR4 - 2TB NVME

iPhone 12 Mini / Sony WH-1000XM4 / Bose Companion 20

Link to comment
https://linustechtips.com/topic/1394853-fast-png-compression/#findComment-15148950
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×