Fwd: [libpng:feature-requests] #32 Modern compressor

Glenn Randers-Pehrson <[email protected]>
Newsgroups gmane.comp.graphics.png.general
Message-ID <CA+PdXctc=psVBrBfn1dNh6ou7MhAZuf4CQvAizSmLH61PnHFrQ@mail.gmail.com>
On Fri, Dec 30, 2016 at 10:24 PM, Cosmin Truta <[email protected]>
wrote:

> On 30 December 2016 at 16:41, John Bowler
> <[email protected]> wrote:
>
> I would be happy enough to see our present-day PNG format being used
> in digital photography. Never mind exceeding 24-bit. Even for plain
> true-color images, deflate-compressed TIFF is more suitable than PNG,
> because TIFF can hold EXIF and PNG can't. For digital photographers
> (myself included), EXIF is super-precious.
>
> In theory, PNG can hold any metadata. In practice, there have been two
> or three attempts by our group to incorporate EXIF into PNG, back in
> early 2000's, all of which failed.
>
> My attempt to make a special PNG EXIF chunk did fail, but on the
other hand, ImageMagick and GraphicsMagick have been keeping EXIF
data successfully as "raw profiles" for a long time (at least since the
ImageMagick/GraphicsMagick fork of 2004).

Try this, with the current ImageMagick:

    magick DSCnnnn.JPG DSCnnnn.png
    pngcheck -v DSCnnnn.png
    magick DSCnnnn.png DSCnnnn_copy.jpg
    magick identify -verbose DSCnnnn_copy.jpg

and the same with GraphicsMagick:

    gm convert DSCnnnn.JPG DSCnnnn_gm.png
    pngcheck -v DSCnnnn_gm.png
    gm convert DSCnnnn_gm.png DSCnnnn_gm_copy.jpg
    gm identify -verbose DSCnnnn_gm_copy.jpg

You'll get something like this:

pngcheck -v DSCnnnn.png:
  ...
  chunk IDAT at offset 0x9b897b, length 31513
  chunk tEXt at offset 0x9c04a0, length 37, keyword: date:create
  chunk tEXt at offset 0x9c04d1, length 37, keyword: date:modify
  chunk tEXt at offset 0x9c0502, length 27, keyword: exif:BrightnessValue
  chunk tEXt at offset 0x9c0529, length 17, keyword: exif:ColorSpace
  ...

and

magick identify -verbose DSCnnnn_copy.jpg:

  Properties:
    date:create: 2016-12-31T08:28:46-05:00
    date:modify: 2016-12-31T08:28:46-05:00
    exif:BrightnessValue: 50/100
    exif:ColorSpace: 1
  Profiles:
    Profile-exif: 53679 bytes

pngcheck -v DSCnnnn_gm.png:
  chunk zTXt at offset 0x00025, length 31365, keyword: Raw profile type EXIF

GraphicsMagick doesn't display the internals of the EXIF chunk, but
the recovered JPG still has it:

gm identify -verbose DSCnnnn_gm_copy.jpg:

    ....
    User Comment: \000\000\000\000...
    Flash Pix Version: 0100
    Color Space: 1
    Exif Image Width: 3872
    Exif Image Length: 2592
    ...

Or, using ImageMagick to show the GraphicsMagick result:

  magick identify -verbose DSCnnnn_gm_copy.jpg:

  Properties:
    date:create: 2016-12-31T08:39:06-05:00
    date:modify: 2016-12-31T08:39:06-05:00
    exif:BrightnessValue: 50/100
    exif:ColorSpace: 1
    exif:ComponentsConfiguration: 1, 2, 3, 0
    exif:CompressedBitsPerPixel: 8/1
    exif:Contrast: 0
    exif:CustomRendered: 0
    exif:DateTime: 2016:12:02 16:46:32
    exif:DateTimeDigitized: 2016:12:02 16:46:32
    exif:XResolution: 72/1
    exif:YCbCrPositioning: 2
    exif:YResolution: 72/1

Glenn

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot

_______________________________________________
png-mng-misc mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/png-mng-misc
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.