🇺🇦 Anna Filina

@afilina@phpc.social
1.8K Followers
62 Following
4.2K Posts

Legacy software modernization, project rescue, architecture, test automation, public speaking. Working at Zend.

I'm supporting a tactical unit in Ukraine directly. You can help me do more: https://afilina.com/donate/ua-supplies

Bloghttps://afilina.com
Workhttps://www.zend.com/services

Going through a list of PHP dependencies of a legacy project and routinely marking libs as "abandoned in 2008."

You know you're doing legacy archaeology when you download zip copies of code via the wayback machine.

LOL what?! 15K views on a video of one of my talks, as though Nerdearla didn't already have a huge audience.

"Effortless Software Development"

https://www.youtube.com/watch?v=sF_Q20LS21A

Effortless Software Development with Anna Filina at Nerdearla 2023

YouTube
Redirecting

PNG is back!

https://www.programmax.net/articles/png-is-back/ (by Chris Blume)

A new PNG spec was just released! […]

[…] After 20 years of stagnation, PNG is back with renewed vigor!

What's new?

* Proper HDR support (future‐proof, too!)

* Finally recognizes APNGs (animations!)

* Officially supports Exif data

* General tidying up—fixing errata, clarifications, etc.

#png

The kid knows the name of the song when she hears the first few notes of Master of Puppets. I'm proud.
Slack is sending me e-mails trying to win me back with AI after I already cancelled to get away from AI. Something tells me that they didn't delete my workspace as requested, so now I might need to threaten legal action to protect my data privacy.
Automatically adding AI to software that contains user data without prior explicit consent should be illegal. I will die on this hill.

There's no need to stop the game, which can be annoying if you use a lot of mods. Just exit to the main menu.

If you see degraded performance (short freezes) after re-entering the world: it might just be a memory leak from exiting to the main menu. Restart the game to see if it helps before you undo the cloud sync setup.

Example command (you need a junction):

mklink /J "C:\path\to\minecraft\saves\MyWorld" "C:\path\to\dropbox\MyWord"

I had a lot problems recently with my gaming PC, so I needed to reinstall often. Starting Minecraft games from scratch sucked, so I finally came up with this:
- Move the save folder to a Dropbox folder (or if you mod, the whole instance)
- Create a shortcut to it back in the original location, where Minecraft would expect it
- Seamless cloud Minecraft saves
×

PNG is back!

https://www.programmax.net/articles/png-is-back/ (by Chris Blume)

A new PNG spec was just released! […]

[…] After 20 years of stagnation, PNG is back with renewed vigor!

What's new?

* Proper HDR support (future‐proof, too!)

* Finally recognizes APNGs (animations!)

* Officially supports Exif data

* General tidying up—fixing errata, clarifications, etc.

#png

@knurd42 Animated PNG's must be HUGE.

@tripplehelix they certainly can be I'd assume, but I guess the real questions are:

is there a wide enough niche/area between animated gifs and video files where they might be really useful due to their quality vs size ratio?

@knurd42

It's good to have more choice, but as you suggest, I don't see how they'd fit in. I guess they could be great for offline use, where size is not an issue.

@tripplehelix @knurd42 reading between the lines, it seems like PNGs are an intermediate format for video tooling which wants a lossless format for (eg) animated chyron text or other on-screen graphics.

@tripplehelix @knurd42 APNGs with transparency are actually smaller than equivalent WEBPs. APNG has all the same optimizations PNG does and is excellent for anything with large fields of color. Best of all, it's lightweight on the browser since it piggybacks standard PNG handling.

Like all formats, it's not the best for every job, but it's a solid option.

@tripplehelix @knurd42 I think APNGs have interframe compression.

@tripplehelix @knurd42 one would think so but… no, apng can be fairly competitive in size http://littlesvr.ca/apng/gif_apng_webp.html

Also it's the default(and only) format for Signal stickers.

GIF vs APNG vs WebP

@knurd42 Great. Blinky PNGs, just what I always wanted.

@knurd42

>APNG support

I kinda thought we were over this considering animated WebPs and AVIF exist, was there really any interest in bringing back Animated PNGs?

@knurd42 that's super cool.. When can we expect universal integration? Some time after the climate collapse?

@naught101

Exactly my thought!

@knurd42

@mina @naught101 @knurd42

"Universal" is a big ask :)
But it is already live in Chrome, Safari, Firefox, iOS/macOS, Photoshop, ...
A bunch of software.

Also in broadcast. So overlays in sports, news, etc.

@knurd42 Unfortunately literally everyone (including libpng) only implements a fraction of the original PNG spec, so I'm not really hopeful for any of these that weren't already de facto supported like Exif. I doubt extended color spaces would be supported very well in anything but pro photo software where it's already supported, for instance

@nytpu @knurd42

Some of it has already landed in libpng. Other parts are currently landing. :)

@nytpu @knurd42 Even if capabilities are not universally implemented, it's still valuable for the way they are implemented to be standardized and not rely on de facto hacks. I think this is very exciting indeed.
@knurd42 WOWW this is cool as hell thanks for posting about it would have missed it other wise <3
@knurd42 I think we hugged the site to death :(
@knurd42 I thought all of these features and issue mitigations were addressed in the JPEGXL standard?
@knurd42 will i have to buy an app from the windows store just to look at these images? (like heic).

@knurd42 Skimmed over it, and while I am hyped, I think their HDR implementation is lacking especially for common applications such as video game assets.

4 bytes for 4 floats is a drastic reduction of color resolution, showing a short-sighted perception of images always being "photos", instead of, e.g., linear space color textures.

So yeah. I'm afraid PNG is back for everyone else but us game devs.

@jupiter @knurd42 to be fair at 16bit/channel PNGs you can have better precision, but yes, this is very much aimed at “HDR photos”, and not “arbitrary floats”

@aras @knurd42 hence no transparency either.

16 bit per channel/half precision floats are a good start. Never seen them work well yet.

And that's my critique. It's almost exclusively for display, not image interchange.

@jupiter @aras @knurd42

I'm actually particularly interested in the game dev space. I've been pushing the group to allow us to store extra channels (so normals, bump maps, etc) in the same image.

I think there may be some confusion here, though. The 4 bytes are just to indicate the properties of the image's color space. The image data itself is still up to 16-bit (with transparency, too).

@jupiter @knurd42 Maybe they just feel like EXR solves that problem well enough that adding it to PNG adds complexity to PNG implementations without really making anybody's life better.

@wrosecrans @knurd42
EXR does key alpha now? (afaik it does premultiplied only, which is destructive and sucks)

All I want is a plain half or single precision float, 4 channel RGBA format with linear color and widespread support.

@jupiter @knurd42 EXR always did Alpha. Alpha conventions are a bit different than PNG:

https://openexr.com/en/latest/TechnicalIntroduction.html#premultiplied-vs-un-premultiplied-color-channels

But yeah it's pretty much universal in film VFX tooling for textures, render passes, etc. 16b half, 32b float, bucket for as many channels of linear data as you want. Even has schema for specifying stuff like intended wrap mode if you are using it as a texture: https://openexr.com/en/latest/StandardAttributes.html#anticipated-use-in-pipeline

Technical Introduction to OpenEXR

@wrosecrans @knurd42 pre multiplied needlessly destroys image information, I wonder why anyone would store their images with it. There isn't even a space advantage.

I read that article and just scratch my head.

Afaik premul alpha baked into image files is a remnant from fixed function pipelines. (the math involved is good and appropriate to use, but it should be done in the fragment shader, at runtime, because otherwise you can do exactly 1 type of alpha compositing, ever)

@wrosecrans @knurd42 the amazing and mathematically lossy and incorrect HACK these hacks explain in that doc...

Guys, your color is GONE after premul with zero, you will never get it back.

Add a flag that tells us what format the channels are in, already... 🥲. I'm sick of losing color information and precision when stuff is transparent.

Additive and subtractive blending and destination alpha exists. Not everything is an overlay.

It would have cost them $0 to reserve that in the file header.

@jupiter @knurd42 Heh, I am used to premult alpha, so it's the only thing that makes sense to me. You can certainly stick unassociated alpha in an EXR if you prefer that, it's just not the most common convention.

Typical use case is something like an object with a glow. Where you have rgb image > 0 but alpha=0, a standard over operation adds the glow to the bg. No good way to represent that with unassociated alpha, cuz the glow will get multiplied by 0 in the over operation.

@wrosecrans @knurd42
🤔 You have a point. I was unable to explain this to artists so we always ended up with separate glow maps in separate layers.
I should take another shot at researching how to export from a graphics program like this.
Anything from Paint.NET to Photoshop seems to save 0 alpha with RGB also zero.
@jupiter @knurd42 One nice thing about EXR vs stuff like PNG is that you can just have a channel that is "Glow" or whatever. The flexibility can be a pain in the neck sometimes, but EXR just DGAF about what your data is. You can have a 6 channel [R, G, B, Armor thickness, Glow, Shininess] image if that's useful for you and all the tooling will propagate "this is the 'Glow' channel" so you don't have to remember you packed glow into channel 1 or whatever.
@jupiter @knurd42 I'm not saying PNG is bad or anything. I didn't mean to come into the conversation as a hardcore EXR evangelist, ha ha.
Just, if you want an image container for 32 bit float data to use as textures in technical pipelines, PNG might be focused on solving a different set of problems.
@wrosecrans @knurd42 no worries, I was uninformed :)
@jupiter @knurd42 It invented quarter-float data type?
@jupiter sorry but what do you need HDR for in a game? asking as a game dev, though not necessarily one concerned with pointlessly trying to use the new hot thing and bumping the minimum required specs

@sylvie environment maps / skyboxes / lights / light maps / reflection probes are the most common use, but there are more.

Post processing and color grading operates also usually in a flavor of HDR.

This does not necessarily mean HDR *output* ...

Games have calculated internally with high dynamic ranges for a long time (~2 decades!)

For instance, most bloom effects in the past 15+ years worked with a HDR pixel format so white clouds don't glow as much as the sun or red flames, for instance.

@jupiter so strictly speaking, 3d games, which would probably want to be using a for-GPU image format in the first place?

@knurd42

For photographers, having to use JPG as the only output to retain embedded EXIF data was not the ideal. If this is to be the new default, the question is, how can older (outdated, defunct, dead, or abandoned) photo processing software make use of it.

Does this mean adding some other post-processing tool into workflows to implant the latest additions? I can't assume there's some magic 'injector' that will somehow push HDR or EXIF data into preexisting files without user intervention.

@knurd42 finallyyyyyy been waiting for an HDR spec for so long
@knurd42 Can’t wait for 2045 when all tools will finally have implemented the new version! 🤗
@knurd42 can we finally get proper arithmetic coding support?
I know it has been in the spec, but maybe this time.
Also 32 bit png anytime?
@knurd42 wait, it didn't support EXIF before?

@fishidwardrobe @knurd42

Only JPEG and TIFF support EXIF...

The 1st and 2nd Edition specs don't mention either EXIF or HDR being included or even planned. The old specs use the term "IHDR" and some may assume that's High Dynamic Range, but it actually describes the file's "Header' data, that holds dimmensions (height, width) for the transparent black rectangle as the bounding box of the entire image... (and now, animation stages).

https://www.w3.org/TR/2003/REC-PNG-20031110/

https://www.w3.org/TR/png-3/

Portable Network Graphics (PNG) Specification (Second Edition)

@knurd42 APNG is pronounced Jiff.
@knurd42 will it be as successful as YAML1.2?
@knurd42 oh no, they changed something. stop changing existing standards
@knurd42 Ok but APNG with sound when 🤡

@knurd42 I'm very interested in seeing an upgraded #PNG format! Since the official PNG spec seemed stagnant, I was jotting down ideas on an upgraded PNG myself ( https://mooncore.eu/bunny/txt/pngx-eval.htm ), but I guess if the big guys like @ProgramMax are on it, I can wait and see what they come up with. :D

Although if they go with zstd for the new compression, I'll be sad.

Evaluation of PNGX ideas

Evaluation of easy improvements for the PNG image format

@knurd42 cant believe they improved upon perfection, awesome.

@knurd42

I've been using png for a few years now to save photo edits losslessly for working on in different editing programs.

@knurd42
Now how long will it take for the software libraries to catch up?
@knurd42 So basically a lot of things that JpegXL has already tackled?