• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

How do you embed resolution/scale in a png?

Explorer ,
Feb 26, 2018 Feb 26, 2018

Copy link to clipboard

Copied

I’m looking for a way to embed resolution (ppi) information in a png when exporting from Photoshop. I believe it’s possible because if you re-open a png, Image>Image Size>300ppi, save, then it behaves properly. Illustrator’s newish asset export feature can do it too.

I see that questions similar to this get asked an awful lot but answers generally come back along the lines of “Ima explain you all about raster resolution for screens and why changing from 72ppi to 300ppi won't make it print better do something else instead”, so I’ll try to be precise about what I’m asking and why;

  • I have a large library of thousands of pngs which are used as modular elements in Illustrator compositions for print.
  • The pngs which I’ve exported from Illustrator using the asset export panel, with 300ppi explicitly set as the scale, appear at the correct size on the artboard when brought back into Illustrator.
    • Just to be clear, when I talk about scaling objects in Illustrator I mean transforming the object’s size relative to an artboard of a certain print size and not altering the pixel dimensions of the png itself.
  • The problem is pngs exported from Photoshop; when brought in to Illustrator they appear exactly 416.66% too large, in other words they’re 72ppi against the artboard. I have to scale them down by 24% to make them 300ppi against the artboard (otherwise they’re blurry when printed).
    • I can’t find any way in Photoshop to explicitly set the ppi of exported files …
    • The Photoshop file from which these pngs were exported has 300ppi set under Image>Image Size. This makes no difference.
    • The raster effect settings in Illustrator is 300ppi… (a red herring that people like to talk about)

There are three solutions (workarounds) I know of;

  1. re-scale objects in Illustrator by 24%. I’ve got an action for this. It works, but I’d rather have the images automatically appear at the right scale in the first place.
  2. Import PSDs to Illustrator and use the asset export panel with the scale/resolution explicitly set to 300ppi. Its works beautifully except that, for some reason, the pngs seem to be lower quality/smaller file size than when exported from Photoshop. Hmm!
  3. Batch-run an action that sets Image>Image Size>300ppi on the entire png library directory… takes ages and has to be run on all new pngs coming in.

So if you know of a way to have Photoshop embed resolution/scale/ppi info in a png then I’d love to hear it!

So far I’ve tried;

Cheers!

TOPICS
Actions and scripting

Views

1.8K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
LEGEND ,
Feb 26, 2018 Feb 26, 2018

Copy link to clipboard

Copied

This was clearer when the Export option was called Save For Web. Since it was for saving for web, the argument goes, resolution was irrelevant, so PNGs did not set it. Unfortunately calling it Export makes it sound a general feature, but it isn't! So use Save As instead of Export.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 26, 2018 Feb 26, 2018

Copy link to clipboard

Copied

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 26, 2018 Feb 26, 2018

Copy link to clipboard

Copied

LATEST

Further to Test Screen Names​ – post #1

Using export/save for web strips some or all metadata (even if S4W is set to retain metadata)…

In CC2018 – Save As PNG results in the following key metadata values being set, which are not included in the other various export options (my original was 288ppi😞

[PNG-pHYs]      PixelsPerUnitX     :    11339

[PNG-pHYs]      PixelsPerUnitY     :    11339

[PNG-pHYs]      PixelUnits         :    meters

(Reported via ExifTool)

PNG PhysicalPixel Tags

11.8. Physical Pixel Dimensions (pHYs)

4.2.4.2. pHYs Physical pixel dimensions

So a value of 113.39 (CM) x 2.54 (Metric Inch Conversion) = 288 ppi

The PNG specification works in a unit value of metres. Photoshop apparently translates the embedded PNG-pHYs data into PPI when opening the file (even if rulers are set to say CM).

There appears to be some rounding up, for 288 ppi in CM = 113.386 or 113.39

The ExifTool command to change from say 288 ppi (11339) to 144 ppi (5670) =

exiftool -PixelsPerUnitX=5670 -PixelsPerUnitY=5670 -PixelUnits=meters 'path to file here'

So the above command could be used to re-embed the required metadata into PNG files exported from Photoshop, without needing to re-open and re-save the PNG files.

Note: There were non-standard metadata writing changes in CC2015 which have been removed in CC2018:

Photoshop CS6 vs CC2015 PNG Resolution & Unit

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines