PNG is back! (www.programmax.net)
from jwr1@kbin.earth to programming@programming.dev on 24 Jun 22:28
https://kbin.earth/m/programming@programming.dev/t/1528736

After 20 years, PNG is back with renewed vigor! A new PNG spec was just released.

#programming

threaded - newest

vhstape@lemmy.sdf.org on 24 Jun 22:33 next collapse

Great news! PNG has always been my image format of choice due to its relatively good compression and support for transparency.

memoryfoam44@lemm.ee on 24 Jun 23:37 next collapse

PNG has terrible compression and It’s lossless unless you crush the colors. Transparency has been pretty much the only reason to use it.

tal@lemmy.today on 24 Jun 23:48 collapse

PNG has terrible compression

It’s fine if you’re using it for what it’s intended for, which is images with flat color or an ordered dither.

It’s not great for compressing photographs, but then, that wasn’t what it was aimed at.

Similarly, JPEG isn’t great at storing flat-color lossless images, which is PNG’s forte.

Different tools for different jobs.

dormedas@lemmy.dormedas.com on 25 Jun 00:03 collapse

JPEG isn’t great at storing flat-color lossless images, which is PNG’s forte.

JPEG isn’t, but JPEG-XL, on the other hand, has come into existence and has great compression while being pixel-perfect lossless as compared to PNG (among a host of other improvements).

If only it got the support it deserves (thanks Google for making that harder)

aeroplayne@lemm.ee on 25 Jun 10:41 next collapse

Do you remember png? Well now it’s back. In pog form!

RizzRustbolt@lemmy.world on 25 Jun 19:39 collapse

Eventually they’ll adopt the multi-page specs and finally push Adobe off the mountain.

Flamekebab@piefed.social on 24 Jun 22:41 next collapse

APNG wasn't officially part of the spec?!

roadrunner_ex@lemmy.ca on 24 Jun 23:09 next collapse

I’m glad it is now. I remember a decade or so ago, I wrote an APNG decoder, so I was deep in the world of APNG.

And I remember reading various things that made me think MNG was the ‘more official’ flavour of “animated PNG”, and it was absurd to me, because APNG seemed like a much more approachable spec. I’m glad the winds have turned…

thingsiplay@beehaw.org on 24 Jun 23:33 collapse

I remember MNG and never understood why APNG wasn’t officially recognized. I didn’t know it was widely supported already. Why do people still create and use GIF in the internet, if there is a superior format?

tal@lemmy.today on 24 Jun 23:46 collapse

At least at one point, GIF89a (animated GIF) support was universal among browsers, whereas animated PNG support was patchy. Could have changed.

I’ve also seen “GIF” files served up online that are actually, internally, animated PNG files, so some may actually be animated PNGs. No idea why people do that.

KiwiTB@lemmy.world on 24 Jun 23:33 collapse

Crazy huh but APNG was so well done it just showed the first frame like a normal PNG in any non supported browser which was amazing. I used to have an avatar which has the TF2 engineer as the first frame and the spy as the second.

sentient_loom@sh.itjust.works on 24 Jun 22:52 next collapse

I didn’t realize it had gone anywhere. It’s always my first choice.

tal@lemmy.today on 24 Jun 23:05 collapse

WebP had been kind of moving in on its turf, based on what I’ve been seeing websites using.

sentient_loom@sh.itjust.works on 25 Jun 09:54 collapse

I’ve never heard of webP. Looked it up. Not impressed. Sticking with png.

Sorse@discuss.tchncs.de on 25 Jun 10:12 next collapse

The main advantage of webp is that it has good lossy compression, which makes it great for websites that show tens or hundreds of images on a single page

realitista@lemmy.world on 26 Jun 09:38 collapse

I always used PNG where I would have used GIF. Other than that I use JPG still. I’m guessing webp is more on the JPG side of things than the GIF side?

azertyfun@sh.itjust.works on 26 Jun 19:37 collapse

It can do both, lossiness is toggleable.

If you’ve seen a picture on Lemmy, you’ve almost certainly seen a WebP. A fair bit of software – most egregiously from Microsoft – refuses to decode them still, but every major browser has supported WebP for years and since superior data efficiency compared to JPG/PNG means is already very widely used on the web. Bandwidth is not that cheap.

xiwi@lemmy.dbzer0.com on 26 Jun 10:03 collapse

Who would want to use a format named web-pee

BootLoop@sh.itjust.works on 26 Jun 11:03 collapse

Web-pee is stored in the web-balls

tal@lemmy.today on 24 Jun 23:26 next collapse

What’s next?

I know you all immediately wondered, better compression?. We’re already working on that. And parallel encoding/decoding, too! Just like this update, we want to make sure we do it right.

We expect the next PNG update (Fourth Edition) to be short. It will improve HDR & Standard Dynamic Range (SDR) interoperability. While we work on that, we’ll be researching compression updates for PNG Fifth Edition.

One thing I’d like to see from image formats and libraries is better support for very high resolution images. Like, images where you’re zooming into and out of a very large, high-resolution image and probably only looking at a small part of the image at any given point.

I was playing around with some high resolution images a bit back, and I was quite surprised to find how poor the situation is. Try viewing a very high resolution PNG in your favorite image-viewing program, and it’ll probably choke.

  • At least on Linux, it looks like the standard native image viewers don’t do a great job here, and as best I can tell, the norm is to use web-based viewers. These deal with poor image format support support for high resolutions by generating versions of the image at multiple pre-scaled levels and then slicing the image into tiles, saving each tile as a separate image, so that a web browser just pulls down a handful of appropriate tiles from a web server. Viewers and library APIs need to be able to work with the image without having to decode the whole image.

    gliv used to do very smooth GPU-accelerated panning and zooming — I’d like to be able to do the same for very high-resolution images, decoding and loading visible data into video memory as required.

  • The only image format I could find that seemed to do reasonably well was pyramidal TIFF.

I would guess that better parallel encoding and decoding support is likely associated with solving this, since limiting the portion of the image that one needs to decode is probably necessary both for parallel decoding and for efficient high-resolution processing.

duckythescientist@sh.itjust.works on 25 Jun 05:39 next collapse

Yeah, I have a couple over 800MB PNGs that I can only get Gimp to open properly. I need to look into pyramidal TIFFs.

DaPorkchop_@lemmy.ml on 25 Jun 09:23 next collapse

There is a reason why TIFF is one of the most popular formats for raster geographic datasets :)

[deleted] on 25 Jun 09:31 collapse
.
[deleted] on 25 Jun 09:35 next collapse
.
DaPorkchop_@lemmy.ml on 25 Jun 10:00 collapse

Again, that would be TIFF. TIFF images can be encoded either with each line compressed separately or with rectangular tiles compressed separately, and separately compressed blocks can be read and decompressed in parallel. I have some >100GiB TIFFs containing elevation maps for entire countries, and my very old laptop can happily zoom and pan around in them with virtually no delay.

bestboyfriendintheworld@sh.itjust.works on 26 Jun 09:08 collapse

JPEG2000 can do exactly what you want for decades.

tal@lemmy.today on 24 Jun 23:43 next collapse

On the “better compression” front, I’d also add that I doubt that either PNG or WebP represent the pinnacle of image compression. IIRC from some years back, the best known general-purpose lossless compressors are neural-net based, and not fast.

kagis

fahaihi.github.io/NNLCB/

These guys apparently ran a number of tests. They had a neural-net-based compressor named “NNCP” get their best compression ratio, beating out the also-neural-net-based PAC, which was the compressor I think I recall.

The compression time for either was far longer than for traditional non-neural-net compressors like LZMA, with NNCP taking about 12 times as long as PAC and PAC taking about 127 times as long as LZMA.

mindbleach@sh.itjust.works on 25 Jun 02:32 next collapse

Possibly the final version. Quite Okay Imaging (QOI) achieved similar compression with none of the complexity. Lossy + difference = lossless formats are surely the better option where performance is not crucial. Even the fact they fffucking finally made APNG official is decades late to replace GIF, since several image formats are now literally video formats.

The future is webp. And telling software patents to burn in hell.

spartanatreyu@programming.dev on 25 Jun 04:53 next collapse

The future is webp JPEG XL

And telling software patents to burn in hell.

MonkderVierte@lemmy.zip on 25 Jun 09:28 collapse

Never saw even one piece of your “future” in the wild…

bob_lemon@feddit.org on 25 Jun 12:24 next collapse

That’s because Google removed the support from chrome after only a few months, and Mozilla never added it to Firefox. And although there’s apparently an extension for both, (lossy) image formats need out of the box browser support to have any chance for any kind adoption.

soc@programming.dev on 25 Jun 20:32 next collapse

Happily using it for presentation slides.

spartanatreyu@programming.dev on 25 Jun 23:24 collapse

Try this link on an iPhone: jpegxl.info/resources/jpeg-xl-test-page.html

Flipper@feddit.org on 25 Jun 05:28 collapse

As cool and impressive as Qoi is, as long as I can’t just send it to someone it’s sadly not a replacement for PNG.

mindbleach@sh.itjust.works on 25 Jun 15:30 collapse

Yeah, adoption’s not a feature you can design.

The general idea may show up in any extensible format. Like a PNG encoder that only does Sub filter can encounter each pixel once.

… wait, PNG filtering is byte-level? It doesn’t change with bit depth? Christ.

captainastronaut@seattlelunarsociety.org on 25 Jun 08:09 next collapse

May webp die a horrible death in its wake!

FizzyOrange@programming.dev on 25 Jun 10:17 next collapse

WebP was the first widely supported format to support lossy transparency. It’s worth it for that alone.

LaggyKar@programming.dev on 25 Jun 17:11 next collapse

Lossless WebP is still gets way better compression than PNG though, this doesn’t change that. Although they mention they’re looking to improve it in the next version, so we’ll see then.

Emotional@lemmy.blahaj.zone on 26 Jun 05:08 collapse

why?

kipo@lemm.ee on 26 Jun 05:24 collapse

Because most of my software doesn’t have support for webp, including but not limited to my Mac, phone, and messaging apps. Until everything supports it, I have to keep converting it to use it, so I just don’t bother saving anything as webp. In fact, I have a firefox extension that lets me save webp as other image formats.

It may be good to use for the web, but it’s not yet good for me.

Emotional@lemmy.blahaj.zone on 26 Jun 16:38 collapse

I personally love WebP and other innovative formats, I don’t wish them dead, because better compression saves time and bandwidth.

However, for saving stuff on my computer, like you, I would tend to go for more supported formats.

I’m mostly just sad that it takes so long for new formats to be widely supported.

SonOfAntenora@lemmy.world on 26 Jun 19:52 collapse

You have no choice there. Outside of web pages it’s undersupported. Is it the fault of the file format or of software that doesn’t support the format?

WolfLink@sh.itjust.works on 25 Jun 10:05 next collapse

HDR PNG is huge

BetterDev@programming.dev on 25 Jun 17:30 next collapse

Um, actually it’s pronounced png

f4f4f4f4f4f4f4f4@sopuli.xyz on 26 Jun 03:11 collapse

Correct. Like “plunge” without the “lu”.

Almacca@aussie.zone on 26 Jun 04:37 next collapse

Took me a second to realise you’re not talking about Papua New Guinea.

Grant_M@lemmy.ca on 26 Jun 05:20 next collapse

Yes. But does Lemmy support .png? <img alt="" src="https://lemmy.ca/pictrs/image/a0dc1651-ea5d-4bac-8dfd-2da3aeb6ebc1.png">

Ahh.

realitista@lemmy.world on 26 Jun 09:37 next collapse

Did it go away? I still use it as my go to format for small lossless images.

reactionality@lemmy.sdf.org on 26 Jun 12:15 collapse

Good. Kill webp and its incompatible ass.