Closed Bug 578183 Opened 14 years ago Closed 14 years ago

Add support for the JNG image format

Categories

(Core :: Graphics: ImageLib, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 88020

People

(Reporter: john, Unassigned)

Details

User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-GB; rv:1.9.2.6) Gecko/20100625 Firefox/3.6.6 Build Identifier: It is possible to use a lossily compressed image on the web with JPEG, or to have a partially transparent image with lossless compression PNG, but it's not possible to have both. Non rectangular images are very useful in web design, but many do not compress well with the zlib compression in PNG. JNG is an extension to PNG which allows an image to be compressed with the JPEG algorithm while keeping support for an alpha channel. There are possible workarounds involving masking an opaque JPEG using canvas support, or embedding a flash object (flash does support the equivalent function of JNG), but nothing that can be used in a declarative fashion such as in CSS. A long while ago, Mozilla/Netscape supported JNG images via libmng which provided support for the MNG and JNG formats; libmng was removed to reduce code size and remove the complicated MNG format. Animated images were later replaced with the addition of APNG, but no support nor replacement for JNG. JNG is a simple extension to PNG (in comparison to MNG), and it should to be possible to extend libpng to support it. Such extensions ought to be accepted upstream since JNG is a officially supported extension of PNG. I'm happy to look at extending mozilla's copy of libpng to support JNG, but don't have a lot of time at the moment. Anyone else feel free. Reproducible: Always
Status: UNCONFIRMED → RESOLVED
Closed: 14 years ago
Resolution: --- → DUPLICATE
See also bug 500500 as JPEG XR would also address the need expressed in this post (as it supports an alpha channel), it looks like it may soon have more widespread adoption than JNG, and it is also a significant improvement for low bitrate lossy images. However, I can't comment on the IPR status of the JPEG XR format. It may ultimately not be suitable but that determination should be made before concluding that JNG is a superior solution.
Yes, JPEG XR would also meet the need, as would JPEG 2000 which I believe supports alpha (bug #36351). As far as I know there is no suitably licensed code for JPEG-XR, it would be a huge task to write some, and I don't know what the patent situation is. JPEG 2000 would be a huge amount of extra code in comparison to JNG.
You need to log in before you can comment on or make changes to this bug.