Re: How "Print Size" can save pixel density into e.g. png file?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> Date: Wed, 8 May 2013 10:34:29 +0300
> From: andrey.krieger.utkin@xxxxxxxxx
> To: gimp-developer-list@xxxxxxxxx
> Subject: How "Print Size" can save pixel density into e.g. png file?
>
> I use the feature of changing image print density (in dpi) in GIMP to
> get predictable size of printed image. Now i want to do this
> programmaticaly. I tried to grep the code, but it would take me long
> time to figure this out by myself. Could please somebody describe in
> which way png file carries pixel density information, or point to the
> place in code that actually does this information saving to file.
> Thanks in advance.
> --
> Andrey Utkin
> _______________________________________________
> gimp-developer-list mailing list
> gimp-developer-list@xxxxxxxxx
> https://mail.gnome.org/mailman/listinfo/gimp-developer-list


Sounds like you need to look at the PNG specs themselves, not necessarily GIMP's method of writing to them:

http://www.libpng.org/pub/png/spec/1.2/PNG-Contents.html
http://www.libpng.org/pub/png/spec/1.2/PNG-Structure.html

Specifically, DPI is encoded into the PNG file in the "pHYs" data chunk, as a pair of 4-byte unsigned integers representing "pixels per unit" along each axis, followed by a single byte specifying the unit of measure (note the only supported unit is "meter", not "inch").

http://www.libpng.org/pub/png/spec/1.2/PNG-Chunks.html#C.pHYs


-- Stratadrake
strata_ranger@xxxxxxxxxxx
--------------------
Numbers may not lie, but neither do they tell the whole truth.
_______________________________________________
gimp-developer-list mailing list
gimp-developer-list@xxxxxxxxx
https://mail.gnome.org/mailman/listinfo/gimp-developer-list

[Index of Archives]     [Video For Linux]     [Photo]     [Yosemite News]     [gtk]     [GIMP for Windows]     [KDE]     [GEGL]     [Gimp's Home]     [Gimp on GUI]     [Gimp on Windows]     [Steve's Art]

  Powered by Linux