Decryption on PNG files

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,862
16,010
Is there a drawback to it?
Others that the time needed to do the conversion, no.

Of course, there's an issue with the compression factor, that lower the quality of the image. But it's not different than with JPEG, with generally a smaller size for the same level of quality.
It's more the fact that it's a (relatively speaking) new format, and therefore that it doesn't come in mind as a solution, as easily as JPEG do, that make it less used. People have the habit since decades to rely on PNG and JPEG, and still need to take the habit to use WEBP in place of the second.

If you looks around you, the same apply outside of the adult gaming scene. By example, there's still few websites that switched to WEBP. I guess that it's partly due to the fact that its supports came late in Windows, while users tend to not regularly update their software, what mean that, for a long time, they were still using a browser that wasn't WEBP compliant.

All this just mean that, as I said, it's not an alternative that come to mind due to the context. People don't use WEBP because they aren't aware that it exist, or don't see it wildly used and so are uncertain about what it can worth.
But if you look at the adult gaming scene, since compression became a thing here, there's more and more games that come directly with WEBP files ; sometimes hidden behind a "jpg" extension since Ren'Py don't care about this part.
 

coffeeaddicted

Well-Known Member
Apr 13, 2021
1,812
1,474
Others that the time needed to do the conversion, no.

Of course, there's an issue with the compression factor, that lower the quality of the image. But it's not different than with JPEG, with generally a smaller size for the same level of quality.
It's more the fact that it's a (relatively speaking) new format, and therefore that it doesn't come in mind as a solution, as easily as JPEG do, that make it less used. People have the habit since decades to rely on PNG and JPEG, and still need to take the habit to use WEBP in place of the second.

If you looks around you, the same apply outside of the adult gaming scene. By example, there's still few websites that switched to WEBP. I guess that it's partly due to the fact that its supports came late in Windows, while users tend to not regularly update their software, what mean that, for a long time, they were still using a browser that wasn't WEBP compliant.

All this just mean that, as I said, it's not an alternative that come to mind due to the context. People don't use WEBP because they aren't aware that it exist, or don't see it wildly used and so are uncertain about what it can worth.
But if you look at the adult gaming scene, since compression became a thing here, there's more and more games that come directly with WEBP files ; sometimes hidden behind a "jpg" extension since Ren'Py don't care about this part.
Sounds good to me.

I just have to find the software that converts it for me.
I am long time user of FastStone since its low on resources and quick. But this doesn't support converting to Webp, it can read it though.
But this seems like a no-brainer as the games itself would be much smaller. It may not matter to small games, but really large file games certainly would benefit from it.

What's odd is that Windows 11 own image viewer doesn't seem to support WebP which is quite strange considering that Windows 11 is relatively new.
 

RightWayTwo

New Member
May 29, 2022
2
1
Hey, just looking through this thread. I found this game from a website and I'm having trouble looking at the png files. I've tried to change the header and I don't know if I'm doing something wrong or if it's just something I haven't read yet. Thanks.
 

79flavors

Well-Known Member
Respected User
Jun 14, 2018
1,607
2,254
Hey, just looking through this thread. I found this game from a website and I'm having trouble looking at the png files. I've tried to change the header and I don't know if I'm doing something wrong or if it's just something I haven't read yet. Thanks.

The problem is the game developer can do whatever they like to the files.
Some will only mess with the file header, so that normal file viewers won't recognize the file as a .png.
Whereas some will rewrite the whole file.

... and it will change from game to game and even sometimes from release to release.

I made a request a few years ago here on F95 and a kind soul (who knew what they were talking about) wrote a simple program to decode the files in the game I wanted to break apart. An update later, the encoding had changed again and things needed to be revised again.

As I understand it, the simplest way is to take a look at the file header for the encrypted image and at a similar header for a normal image of the same type - then try to see if you can figure out what the developer did to convert one to the other. Most people will take the path of least resistance and do a simple transform (like add +1 to each byte of the file - then to decode, they just subtract 1... well actually an XOR instruction, but most non-programmers wouldn't recognize that as an example). But some will be more complicated. Keep in mind, the more complicated the solution, the slower their game will feel - another reason why they'll often go for the simple solution rather than a more robust one.

A handy resource is the Wikipedia article about different file types and their header information:


So for example:
  • .png = 89 50 4E 47 0D 0A 1A 0A
  • .jpg (1) = FF D8 FF DB -or-
  • .jpg (2) = FF D8 FF E0 -or-
  • .jpg (3) = FF D8 FF E1 -or-
  • .jpg (4) = FF D8 FF EE

Edit: It seems my original request thread got updated over the years. The tool that was posted now includes an encryption key guesser which will do a lot of the hard work for you. See : https://f95zone.to/threads/im-looki...m-visual-novel-maker-games.21914/post-2603595
It may or may not work with the files you are trying to look at.
Hmmm... the key guesser may just be json files. Perhaps back to plan-A?
 
Last edited: