Input:
Code: Select all
Image: 1.png
Format: PNG (Portable Network Graphics)
Mime type: image/png
Class: DirectClass
Geometry: 1000x1000+0+0
Resolution: 39.37x39.37 <--- OK
Print size: 25.4001x25.4001
Units: PixelsPerCentimeter <--- OK
Colorspace: sRGB
Type: PaletteAlpha
Base type: Undefined
Endianess: Undefined
Depth: 8-bit
In the following, the result shows no density and units are undefined even though I supplied both.
convert 1.png -verbose -strip -resize 350x350 -quality 35 -units pixelsperinch -density 35x35 output-THDPI.png
Code: Select all
Image: output-THDPI.png
Format: PNG (Portable Network Graphics)
Mime type: image/png
Class: DirectClass
Geometry: 350x350+0+0
Units: Undefined <--- should be pixelsperinch and Resolution should be converted to those units, but no resolution shows.
Colorspace: sRGB
Type: PaletteAlpha
Base type: Undefined
Endianess: Undefined
Depth: 8-bit
If I remove the strip, then I get Resolution and Units, but the density is not converted from pixelsperinch to pixelspercentimeter.
convert 1.png -verbose -resize 350x350 -quality 35 -units pixelsperinch -density 35x35 output-THDPI.png
Code: Select all
Image: output-THDPI.png
Format: PNG (Portable Network Graphics)
Mime type: image/png
Class: DirectClass
Geometry: 350x350+0+0
Resolution: 35x35 <--- this density is wrong as it should be converted from pixelsperinch to pixelspercentimeter.
Print size: 10x10
Units: PixelsPerCentimeter <---- correct units