Welcome Guest (Log in)


LC 8+9 (44) | Images (21) | Png (3) |
Expander triangle
  • Author
  • Rating
  • Type
  • Revision
  • Downloaded
  • Updated
  • Hermann Hoch
  • StarStarStarStarStar
  • Stack
  • 2
  • 609 Times
  • 11 August 2017
JPNG image compression v1.0.1
2017-08-11 .... v1.0.1 ... upgraded for use in latest versions of LC 6/7/8/9.
2017-08-11 .... v1.0.0 ... first public version, for LC 8/9 only.

[The stack runs on Mac/Win/linux in LC 6/7/8/9. LC 9 is fastest. On RaspberryPi 2/3 use LC 6.5.1 (or 7.0.4 which has minor bugs).]

JPNG (named using JPEG and PNG) is not an image format but a compression method.

It may be appropriate if you have
= large PNG-compressed image data containing transparency,
= the data can have some (controlled) quality loss,
= the data has, for storing in the stack or as file, to go down significantly in size.

JPNG takes features from both JPEG and PNG compression. It saves separately the alphaData (optionally the maskData) of a PNG image and, as JPEG-compressed data, the imageData.

This is NOT LOSSLESS, but retains its quality controlled by the JPEGquality property of LC.
Changing the paintCompression from PNG to JPEG includes to give up transparency, that has thus to be saved separately, of course in the same file.
So, when coming back from a JPNG compression to a PNG-compressed image, you can have transparency back by setting the alphaData, but you have some (controlled) loss from the JPEG compression. (This may even result in a larger data size than the original when decompressing.)

1. Import or paste a PNG image with transparency.
2. Select a JPEGquality and watch the preview and the JPNG info.
3. Apply the JPNG method to result in a property (will be numbered) or in a file.
[4. For testing look at the PNG image, reconstructed from the JPNG.]

Note. In LC 6/7 the button "Paste PNG" uses the clipboardData and not the fullClipboardData. This may force you to use as "intermediate" an image viewer that converts the clipboard correctly.

We do NOT use the JPNG data structure of js or objC, but you can easily convert it to that.

[-hh fecit, August 2017]
Ajax Loader
Expander triangle
User Comments
Expander triangle