Skip to main content
Participating Frequently
August 2, 2021
Question

changing dpi in Action Script not view properly in file info

  • August 2, 2021
  • 3 replies
  • 702 views

The first design using script to generate bunch of png files [more than 1000 files] with wrong dpi/ppi, 
I am trying to find a way to regenerate all files in right dpi/ppi. Action script does the job but if you view on file info, it doesn't update. if you open in photoshop the file has been updated. Just kinda the metadata. Any other way to fix that? [document size remain the same]


For example you have files 1000px x 1000px in 120dpi, then you would like to update into 1000px  x 1000px in 72dpi.  

The problem come down to if you drag those files as smart layer into 72 dpi base psd file.
The smart layer doesn't count on pixel size, it will proportionally resize to fit dpi. for example if you have 1000x1000px but 144dpi file drag into as smart object, drag in to 72dpi file. the smart layer will reduce 50% of size to suit the 72 one. 

 

 

This topic has been closed for replies.

3 replies

Legend
August 4, 2021
I do not understand at all what your problem is.
Can you upload a problematic file with the wrong dpi?
I will change it dpi using Photoshop to the one you need (indicate which one).
You will check whether this file suits you or not.
There will be no metadata in the file.
JJMack
Community Expert
Community Expert
August 2, 2021

Png file do not have smart layers.  Png file format has a fixed size canvas X pixels wide  Y pixels high.  DPI or PPI is a Print setting the size the pixels will be printed,   PNG file are used mainly on the web where resolution is meaningless for displays have a fixed resolution.  All that matters on the web is image canvas size X pixel wide Y pixels high.    You can set the  resolution to any value you need to before you print the image the size you want the print to be.  If the canvas size is small you can print the images large however if you use a low resolution to print large the image quality up close will not be great where human eye can resolve down to 300ppi.   Normally you interpolate Print size image files down in size for use as png files on the web.  That is you scale the large print size canvas image to a new smaller png size canvas size using some interpretation method.

 

Also Smart Object Layer Sizes are normally not the the Smart Object Layer Object's  file size and files pixels.  Smart object layers have a transform for the layer's object that create the smart object layer's pixels.

JJMack
MavisesAuthor
Participating Frequently
August 3, 2021

I am not sure what you mean in last paragaph. My work includes collabrate the files from other designers to make end product. This is issues what I am facing at that moment. dpi/ppi is for printing. I mention this is previous designer left out all the wrong size files. {he has gone already}. Anyway, I found Bridge can update the Metadata in the end.

Thanks for your feedback

Stephen Marsh
Community Expert
Community Expert
August 2, 2021

The official PNG specification states that the PNG resolution unit is in metres (not inches). This can be verified using metadata tools such as ExifTool.

 

So, a 300 ppi save as PNG from Photoshop would embed a value of 11811 ppm (pixels per metre). When Photoshop opens a PNG with this resolution metadata, it performs an “on the fly translation” from PPM to PPI:

 

118.11 x 2.54 = 299.9994 ppi... rounded up this is 300 ppi.

 

I personally use ExifTool to change the metadata:

 

Mac:

 

exiftool -overwrite_original -PNG-pHYs:PixelsPerUnitX=11811 -PNG-pHYs:PixelsPerUnitY=11811 -PixelUnits=meters 'Path to folder or file'

 

Win:

 

exiftool -overwrite_original -PNG-pHYs:PixelsPerUnitX=11811 -PNG-pHYs:PixelsPerUnitY=11811 -PixelUnits=meters "Path to folder or file"

 

 

MavisesAuthor
Participating Frequently
August 3, 2021

if that is a case

if I update "pixels per metre" instead of "pixel per inch" will work?

I end up using adobe Bridge to change the ppi.

I may take a look of the tool. Thanks for the info.