disintegration / imaging

Imaging is a simple image processing package for Go
MIT License
5.3k stars 443 forks source link

Can I Change Image DPI ? #108

Closed jstbyte closed 5 years ago

disintegration commented 5 years ago

There's no way to set the DPI using the imaging API. The imaging.Save and imaging.Encode functions use packages from the standard library (e.g. image/jpeg) and golang.org/x/image subpackages to encode images. These packages don't support saving or retrieving image metadata such as DPI.

inliquid commented 5 years ago

There is no such parameter as "DPI" within an image, DPI is evaluated from resolution when it's applied to particular physical dimensions. So exact same image will have different DPI depending on will it be displayed on 5.5" smartphone, 25" monitor or printed on an A4 paper.