Live data from Hacker News

Compressing Images with Neural Networks

mlumiste.com

21–30 of 75 posts

Re: Compressing Images with Neural Networks

#21
post #10

Anyone know of open models useful (and good quality) for going the other way? I.e., Input is a 800x600 jpg and output is 4k version.

I haven't explored the current SOTA recently, but super-resolution has been pretty good for a lot of tasks for few years at least. Probably just start with hugging-face [0] and try a few out, especially diffusion-based models.

[0] https://huggingface.co/docs/diffusers/api/pipelines/stable_d...

Re: Compressing Images with Neural Networks

#22
post #10

Anyone know of open models useful (and good quality) for going the other way? I.e., Input is a 800x600 jpg and output is 4k version.

Look for SuperResolution. These models will typically come as a GAN, Normalizing Flow (or Score, NODE), or more recently Diffusion (or SNODE) (or some combination!). The one you want will depend on your computational resources, how lossy you are willing to be, and your image domain (if you're unwilling to tune). Real time (>60fps) is typically going to be a GAN or flow.

Make sure to test the models before you deploy. Nothing will be lossless doing superresolution but flows can get you lossless in compression.

Re: Compressing Images with Neural Networks

#23
post #9

How do we know we don't get hands with 16 fingers?

Valid point. Conventional codecs draw things on screen that are not in the original, too, but we are used to low quality images and videos, and learned to ignore the block edges and smudges unconsciously. NN models “recover” much complex and plausible-looking features. It is possible that some future general purpose image compressor would do the same thing to small numbers lossy JBIG2 did.

Re: Compressing Images with Neural Networks

#24
There was an earlier article (Sep 20, 2022) about using the Stable Diffusion VAE to perform image compression. Uses the VAE to change from pixel space to latent space, dithers the latent space down to 256 colors, then when it's time to decompress it, it de-noises that.

https://pub.towardsai.net/stable-diffusion-based-image-compr...

HN discussion: https://news.ycombinator.com/item?id=32907494

Re: Compressing Images with Neural Networks

#25
post #10

Anyone know of open models useful (and good quality) for going the other way? I.e., Input is a 800x600 jpg and output is 4k version.

Look for SuperResolution. These models will typically come as a GAN, Normalizing Flow (or Score, NODE), or more recently Diffusion (or SNODE) (or some combination!). The one you want will depend on your computational resources, how lossy you are willing to be, and your image domain (if you're unwilling to tune). Real time (>60fps) is typically going to be a GAN or flow. Make sure to test the models before you deploy.…

Or else you get Ryan Gosling https://news.ycombinator.com/item?id=24196650

Re: Compressing Images with Neural Networks

#26
post #6
post #5

Earlier quoted context omitted.

Did JPEG2000 really flounder? If your concept of it being a consumer facing product as a direct replacement for JPEG, then I could see being unsuccessful in that respect. However, JPEG2000 has found its place in the professional side of things.

Yes, I do mean broad- rather than niche adoption. I myself used J2K to archive film scans. One problem is that without broad adoption, support even in niche cases is precarious; the ecosystem is smaller. That makes the codec not safe for archiving, only for distribution. The strongest use case I see for this is streaming video, where the demand for compression is highest.

For archiving, I'd recommend having a wasm decompressor along with some reference output. Could also ship an image viewer as an html file with all the code embedded.

Re: Compressing Images with Neural Networks

#27
post #10

Anyone know of open models useful (and good quality) for going the other way? I.e., Input is a 800x600 jpg and output is 4k version.

Magnific.ai (https://magnific.ai) is a paid tool that works well, but it is expensive.

However, this weekend someone released an open-source version which has a similar output. (https://replicate.com/philipp1337x/clarity-upscaler)

I'd recommend trying it. It takes a few tries to get the correct input parameters, and I've noticed anything approaching 4× scale tends to add unwanted hallucinations.

For example, I had a picture of a bear I made with Midjourney. At a scale of 2×, it looked great. At a scale of 4×, it adds bear faces into the fur. It also tends to turn human faces into completely different people if they start too small.

When it works, though, it really works. The detail it adds can be incredibly realistic.

Example bear images:

1. The original from Midjourney: https://i.imgur.com/HNlofCw.jpeg

2. Upscaled 2×: https://i.imgur.com/wvcG6j3.jpeg

3. Upscaled 4×: https://i.imgur.com/Et9Gfgj.jpeg

----------

The same person also released a lower-level version with more parameters to tinker with. (https://replicate.com/philipp1337x/multidiffusion-upscaler)

Re: Compressing Images with Neural Networks

#28
post #11
post #7

Earlier quoted context omitted.

But that's like saying it's difficult to drive your Formula 1 car to work every day. It's not meant for that, so it's not the car's fault. It's a niche thing built to satisfy the requirements of a niche need. I would suggest this is "you're holding it wrong" type of situations that isn't laughable.

There was absolutely an initiative to make J2K a widespread standard

There was absolutely an initiative to make Esperanto a widespread language. But neither point has anything to do with how things actually are
Post reply on HN