Sharp: Set image resolution (dpi)

Created on 19 Mar 2015  路  2Comments  路  Source: lovell/sharp

I think that my search skills are failing me...

Is it possible to manually set the desired dpi of an image?

I have a set of big TIFFs at 300 dpi and I would like to convert them into 300 dpi and 72 dpi JPEGs, is it possible?

Thanks!

question

Most helpful comment

As far as I know, and if I understand your question correctly, the concept of DPI doesn't mean anything in the land of JPEG.

You should be able to achieve the equivalent of a 300DPI to 72DPI conversion by resizing to smaller dimensions, e.g. resize a source 1000x1000 pixel square image to a 1000 * 72 / 300 = 240x240 pixel image.

All 2 comments

As far as I know, and if I understand your question correctly, the concept of DPI doesn't mean anything in the land of JPEG.

You should be able to achieve the equivalent of a 300DPI to 72DPI conversion by resizing to smaller dimensions, e.g. resize a source 1000x1000 pixel square image to a 1000 * 72 / 300 = 240x240 pixel image.

Oh boy... I need to review my concepts of image formats and so on (it's not my area of expertise), as far as I can tell, you're absolutely right! :)

Thanks for the explanation! :+1:

Was this page helpful?
0 / 5 - 0 ratings