User Goal: When saving a file for the web (lossy or lossless) there are some possibilities to through away as much as possible (EXIF metadata, embedded thumbnails, etc) to which is not crucially necessary for display/rendering. Also the color profile information, if the image is already using the default color profile assumed (=sRGB).
Nevertheless I'd like to keep the DPI information as an explicit distinguisher this is a normal resolution file (72DPI aka @1x) this is a @2x (144 DPI) and so forth.
For JPEG the situation is satisfactory
Even when having "Postprocess by ImageOptim" enabled which carries the warning "Might strip away some metadata" the DPI info is still kept. Only if one also disables "Write JFIF header" then the DPI information is lost. So that JFIF header which is quite small is enough to maintain the DPI information.
For WEBP the situation is as follows
[√] Store Metadata: [√] ICC [√] XMP [√] EXIF
DPI information makes it into the WEBP if XMP is enabled.
File with XMP has 2804 bytes more than with no metadata at all.
Is there a somehow more space efficient possibility to get "DPI information" into a WEBP than that?
Possibility for WEBP to keep PPI resolution metadata info when saving lossless + size optimized ?
Possibility for WEBP to keep PPI resolution metadata info when saving lossless + size optimized ?
Last edited by porg on Sat Oct 29, 2022 5:09 pm, edited 1 time in total.
- forum_adm
- Site Admin
- Posts: 1714
- Joined: Fri Dec 23, 2016 9:41 am
- Location: Germany
- Country: Germany
Re: Possibility for WEBP to keep DPI metadata info when saving lossless + size optimized ?
JPEG stores the resolution in the standard JFIF header and in addition into Exif.
WebP stores it only in Exif.
WebP stores it only in Exif.
Re: Possibility for WEBP to keep DPI metadata info when saving lossless + size optimized ?
Why did my export experiments then show that DPI info survived only depending whether XMP was enabled, while the EXIF checkmark did not matter?
My experience contradicts your statement.
My experience contradicts your statement.
- forum_adm
- Site Admin
- Posts: 1714
- Joined: Fri Dec 23, 2016 9:41 am
- Location: Germany
- Country: Germany
Re: Possibility for WEBP to keep DPI metadata info when saving lossless + size optimized ?
Exif is mirrored to the XMP Exif tags, too.
Re: Possibility for WEBP to keep PPI resolution metadata info when saving lossless + size optimized ?
When selecting WEBP as the file output format you have options which metadata to include into the file: None, EXIF, ICC, XMP.
My screenshot below shows my attempts of embedding PPI resolution metadata into a WEBP file with GraphicConverter (GC) and its different methods Quick Convert (QC) • Save for Web (S4W) • Save a Copy as (SC).
- On top the PNG (@2x 144dpi) exported from a .snagx (Snagit capture file)
- Quick Convert (QC): Only when XMP is included the PPI info makes it into the WEBP file.
- Save for Web (S4W): None of the methods write a DPI info into the WEBP file!
- Save a Copy as (SC): Only when XMP is included the PPI info makes it into the WEBP file.
- On the bottom there is "… SNAGIT.webp" @2x export created with SnagIt, which also fails to include the PPI info.
My screenshot below shows my attempts of embedding PPI resolution metadata into a WEBP file with GraphicConverter (GC) and its different methods Quick Convert (QC) • Save for Web (S4W) • Save a Copy as (SC).
- On top the PNG (@2x 144dpi) exported from a .snagx (Snagit capture file)
- Quick Convert (QC): Only when XMP is included the PPI info makes it into the WEBP file.
- Save for Web (S4W): None of the methods write a DPI info into the WEBP file!
- Save a Copy as (SC): Only when XMP is included the PPI info makes it into the WEBP file.
- On the bottom there is "… SNAGIT.webp" @2x export created with SnagIt, which also fails to include the PPI info.
Re: Possibility for WEBP to keep PPI resolution metadata info when saving lossless + size optimized ?
The source file is a .snagx file which was captured on my Retina Screen @2x.
From Snagit I exported a @2x PNG.
This PNG shows as 144 PPI in GraphicConverter and was the source for all my "GC" file export variants.
As this is not a digital camera file, but a PNG export from a graphic app, it seems to have no EXIF, but some minimal metadata in its header.
In the Browser Preview Panel the "Exif" tab is empty. The "Exif tool" tab shows this:
Both IFD0 and PNG-pHYs seem to contain some density information: IFD0 screen resolution + PNG-pHYs print resolution.
How can this resolution info make it into the adequate WEBP counterpart?
From Snagit I exported a @2x PNG.
This PNG shows as 144 PPI in GraphicConverter and was the source for all my "GC" file export variants.
As this is not a digital camera file, but a PNG export from a graphic app, it seems to have no EXIF, but some minimal metadata in its header.
In the Browser Preview Panel the "Exif" tab is empty. The "Exif tool" tab shows this:
Code: Select all
---- ExifTool ----
ExifTool Version Number: 12.49
---- System ----
… Various Filesystem Infos …
---- File ----
File Type: PNG
File Type Extension: png
MIME Type: image/png
Exif Byte Order: Big-endian (Motorola, MM)
---- PNG ----
Image Width: 2362
Image Height: 4320
Bit Depth: 8
Color Type: RGB
Compression: Deflate/Inflate
Filter: Adaptive
Interlace: Noninterlaced
SRGB Rendering: Perceptual
---- PNG-pHYs ----
Pixels Per Unit X: 5669
Pixels Per Unit Y: 5669
Pixel Units: meters
---- IFD0 ----
X Resolution: 144
Y Resolution: 144
Resolution Unit: inches
---- ExifIFD ----
Color Space: sRGB
Exif Image Width: 2362
Exif Image Height: 4320
---- Composite ----
Image Size: 2362x4320
Megapixels: 10.2
How can this resolution info make it into the adequate WEBP counterpart?