PackRat wrote:
> This is a question for Cliff Reiter ("Fractals, Visualization and J",
> chapter 8, "Image Processing") or anyone else who has worked with
> images using J:
>
> How can I change the DPI (dots per inch) resolution of an image with J?
>
> That is, if I have an image with a resolution of 150dpi, how can I
> load, process with J, and resave it at, say, 300dpi or even 200dpi for
> possibly somewhat improved OCR (text or music) use? (I realize that
> the resulting size of the image will be smaller, and that may create
> its own issues. However, it is very important for me to know how to
> change the resolution data.)
>
> The previous paragraph dealt with SCANNED images. How would this be
> done with digital CAMERA images where the image is a given size in
> pixels, but there's no specific dots-per-inch specification? In other
> words, how can I use J to specify a DPI resolution?
>
> Please note that I am NOT asking for how to resize or resample an
> image. Essentially, the pixels should remain untouched, except for the
> portion of the data that indicates the number of dots per inch.
>
> Harvey
>
I installed exiftool in my path (http://www.sno.phy.queensu.ca/~phil/exiftool/)
and use it from J with commands similar to these:
z=.spawn_jtask_ 'exiftool "',q,'" -t -s -d "%Y-%m-%d %H:%M:%S"'
or
z=.spawn_jtask_ 'exiftool -Photoshop:All= "',q,'"
-Copyright=DavidMitchell',":{.6!:0''
to read or update the metadata associated with image files of many formats.
The metadata that I have seen most commonly used as DPI is X Resolution and Y
Resolution and Resolution Unit:
ExifTool Version Number : 6.91
File Name : _MG_9315 120ppi.tif
...
X Resolution : 120
Y Resolution : 120
Resolution Unit : inches
...
--
David Mitchell
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm