Copy link to clipboard
Copied
Hi,
I have a weird issue with png format. I have a file 4956 pixels x 2185 Pixels. resolution 16.667 pixels/inch.
When i save the file and reopen it its 4956 pixels x 2185 Pixels. resolution 17 pixels/inch. visually the file size looks identical to the first file but if i save this file as png again and reopen it the size of the image is shorter on the second png. I work in the forensic industry and this is a major issue for us because of the inaccurate size change. Not sure if this is a bug of something but if anyone can shed some light on this issue it would be great.
Regards,
Abdul
Copy link to clipboard
Copied
I forgot to mention. It looks fine in Photoshop but if i take those images into autocad the size is different.
Copy link to clipboard
Copied
I have reported this issue to Autodesk too to see if the issue is from there side.
Copy link to clipboard
Copied
You can expect the size to vary a little if resaving a PNG. No software will guarantee not to change it. Reasons include:
* compression methods improve (usually, they get better at finding repeated patterns).
* metadata may change length
What any software should do is keep the image unchanged. I suggest if working with forensics that you work with tools that compare pixel values rather than size.
Resolution is metadata and doesn't affect the image either, and sometimes there are small rounding changes, or it's removed causing it to default. Your report is unexpected, but not worrying.
Copy link to clipboard
Copied
PPI metadata in a png file is stored as px/m using a 4 byte integer so conversion will involve some rounding. However ppi is just metadata. As long as your image measures the same number of pixels height x width then you have not lost anything in the image and can assign a new ppi value (just uncheck resample).
Incidentally when I carry out the test here using your dimensions , it re-opens as 16.7 ppi not 17 ppi.
Dave
Copy link to clipboard
Copied
Hi. When you use the "Export as" command, you can check the size in pixels. Some apps adjust the size of images when you import it.
Copy link to clipboard
Copied
Hi Dave,
This is the link to a tif file. https://ufile.io/sk31g . Download that save it as png and open it again and you will see what i am talking about. Although the image visually does not look changed in photoshop but once i save it again as a png and take into autocad the size is different.
Copy link to clipboard
Copied
Do you mean FILESIZE or DIMENSIONS?
Copy link to clipboard
Copied
Hi
I took a look inside your TIFF and the resolution is stored as a rational number 279620256/16777216 pixels per inch. This is approx 16.66666603088379 ppi or 656.1679539718027 ppm
When converted to PNG it is stored in the PNG file as an unsigned integer 656 pixels per meter so some rounding is unavoidable.
As I said earlier though - this is all just metadata so can be changed without altering the pixel image which has no physical size.
Dave
Copy link to clipboard
Copied
Thanks Dave, Stephen and everyone else for there suggestions.
Copy link to clipboard
Copied
ExifTool Results:
[System] FileName : j6101_chevy_intensity.tif[IFD0] ImageWidth : 4956
[IFD0] ImageHeight : 2185
[IFD0] XResolution : 16.66666603
[IFD0] YResolution : 16.66666603
[IFD0] ResolutionUnit : inches
___________
[System] FileName : j6101_chevy_intensity.png (save as)
[PNG] ImageWidth : 4956
[PNG] ImageHeight : 2185
[PNG-pHYs] PixelsPerUnitX : 656
[PNG-pHYs] PixelsPerUnitY : 656
[PNG-pHYs] PixelUnits : meters
[XMP-tiff] XResolution : 16.6666660308838
[XMP-tiff] YResolution : 16.6666660308838
[XMP-tiff] ResolutionUnit : inches
___________
[System] FileName : j6101_chevy_intensity.png (export/save for web)
[PNG] ImageWidth : 4956
[PNG] ImageHeight : 2185
Find more inspiration, events, and resources on the new Adobe Community
Explore Now