Change in image resolution of JPEG

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Change in image resolution of JPEG

Manuel Arroyo-Kalin
Hello

I am using ImageJ to add a scale bar to JPEG files taken with a digital
camera. These are 2048x1536 pix images that are rendered as 17.34 x 13 cm,
300 pix/in images (these data from Photoshop). When I apply a scale bar to
them in ImageJ and save them in Jpeg (at 100 quality) they become
2048x1536 pix images that are rendedreed at 72.25x54.19 cm, i.e. 72 pix
per inch (data also from Photoshop). This is problematic because they are
to go inserted as linked files in a Word document and when I update the
Word field to point to the new images with the scale bars they blow up.
Could anyone let me know if there is an easy fix for this? Is there a
global parameter that makes Imagej save the Jpegs at 300 pix/inch? Thanks
in advance

Manuel
Reply | Threaded
Open this post in threaded view
|

Antwort: Change in image resolution of JPEG

Joachim Wesner
Hi Manuel

ImageJ Interest Group <[hidden email]> schrieb am 05.04.2008 19:49:50:

> Hello
>
> I am using ImageJ to add a scale bar to JPEG files taken with a digital
> camera. These are 2048x1536 pix images that are rendered as 17.34 x 13
cm,
> 300 pix/in images (these data from Photoshop). When I apply a scale bar
to
> them in ImageJ and save them in Jpeg (at 100 quality) they become
> 2048x1536 pix images that are rendedreed at 72.25x54.19 cm, i.e. 72 pix
> per inch (data also from Photoshop). This is problematic because they are

> to go inserted as linked files in a Word document and when I update the
> Word field to point to the new images with the scale bars they blow up.
> Could anyone let me know if there is an easy fix for this? Is there a
> global parameter that makes Imagej save the Jpegs at 300 pix/inch? Thanks

> in advance
>
> Manuel

Are you sure that in the IJ output file there is any resolution unit set at
all?
Or is it Photoshop that defaults to 72pix/inch when there is no special
info in
the file? (I would not call this a change in resolution, as the images are
still
2048x1536, but a change in scale factor resp. pixel density)

The (default) IJ Jpeg writing code is in the built-in plugin
JpegWriter.java.
Apparently, it uses encoder.getDefaultJPEGEncodeParam() to get default
encoding
params before the image is saved, the only param to be changed from the
default is
the quality. One would need to call setDensityUnit() on the param object to
set a
different scale factor as eg. 300pix/inch, but currently the code seems to
rely
on the default settings (I could not find if 72 is really the default or it
uses
"unset" in this case).

Somewhere in this forum and not too long ago there was a thread about an
alternative
JPEG writer that supports higher quality settings than the one used in
JpegWriter.java.
Maybe this writer also supports setting the DensityUnit as you would need
it.

Joachim


______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________
Reply | Threaded
Open this post in threaded view
|

Re: Change in image resolution of JPEG

W. Chan
In reply to this post by Manuel Arroyo-Kalin
Hi Manuel

I don't know of any option that would set the resolution you requested.
But as Joachim pointed out, your picture really has not changed.  It is
just how it was displayed on screen because: dimension (in inches) x
resolution (in pixels/inches) = size (in pixels).  If you right-click on
the picture in your word document, go to format picture to grab the size
tab, you can set it back to whatever size you want.

If you are already in word, you can try this.  First calculate the length
of your scale bar then draw it on top of the image e.g., View | toolbar
and select draw, pick the line tool and draw a horizontal line (length and
thickness can be fix later, hold down the shiftkey will help restrain it
to horizontal).  Similary, right-click on the line for format autoshape,
grab the size tab ...  In this way, you don't have to resave a jpeg
another time which could introduce compression artifact.

--
Pang (Wai Pang Chan, [hidden email], PAB A087, 206-685-1519)
The Biology Imaging Facility (http://staff.washington.edu/wpchan/if/)

On Sat, 5 Apr 2008, Manuel Arroyo-Kalin wrote:

> I am using ImageJ to add a scale bar to JPEG files taken with a digital
> camera. These are 2048x1536 pix images that are rendered as 17.34 x 13 cm,
> 300 pix/in images (these data from Photoshop). When I apply a scale bar to
> them in ImageJ and save them in Jpeg (at 100 quality) they become 2048x1536
> pix images that are rendedreed at 72.25x54.19 cm, i.e. 72 pix per inch (data
> also from Photoshop). This is problematic because they are to go inserted as
> linked files in a Word document and when I update the Word field to point to
> the new images with the scale bars they blow up. Could anyone let me know if
> there is an easy fix for this? Is there a global parameter that makes Imagej
> save the Jpegs at 300 pix/inch? Thanks in advance
Reply | Threaded
Open this post in threaded view
|

Re: Change in image resolution of JPEG

Wayne Rasband
In reply to this post by Manuel Arroyo-Kalin
> I am using ImageJ to add a scale bar to JPEG files taken with a  
> digital camera. These are 2048x1536 pix images that are rendered as  
> 17.34 x 13 cm, 300 pix/in images (these data from Photoshop). When  
> I apply a scale bar to them in ImageJ and save them in Jpeg (at 100  
> quality) they become 2048x1536 pix images that are rendedreed at  
> 72.25x54.19 cm, i.e. 72 pix per inch (data also from Photoshop).  
> This is problematic because they are to go inserted as linked files  
> in a Word document and when I update the Word field to point to the  
> new images with the scale bars they blow up. Could anyone let me  
> know if there is an easy fix for this? Is there a global parameter  
> that makes Imagej save the Jpegs at 300 pix/inch? Thanks in advance

You can do this in ImageJ 1.40d by setting the scale in the  
Analyze>Set Scale dialog to 300 pixels per inch. You can upgrade to  
v1.40d by using the Plugins>Utilities>Update ImageJ command and  
selecting "daily build" from the drop down menu.

-wayne
Reply | Threaded
Open this post in threaded view
|

Antwort: Re: Change in image resolution of JPEG

Joachim Wesner
Hi Wayne,

> > Could anyone let me
> > know if there is an easy fix for this? Is there a global parameter
> > that makes Imagej save the Jpegs at 300 pix/inch? Thanks in advance
>
> You can do this in ImageJ 1.40d by setting the scale in the
> Analyze>Set Scale dialog to 300 pixels per inch. You can upgrade to
> v1.40d by using the Plugins>Utilities>Update ImageJ command and
> selecting "daily build" from the drop down menu.
>
> -wayne

I´m again deeply impressed, superfast response! WOW, This way, ImageJ is
fun!

Joachim


______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________
Reply | Threaded
Open this post in threaded view
|

Re: Change in image resolution of JPEG

Manuel Arroyo-Kalin
In reply to this post by Manuel Arroyo-Kalin
Dear Wayne,

Many thanks for sending 1.40d which I have installed - however, when I
go to Analyze>Set scale I still get

Distance in pixels __
Known distance __
Pixel aspect ratio __
Unit of length __

Scale:<no scale>

{} global


Maybe I am missing the point but I am not sure I see how I can use any
of the above to set it to 300 pix/in, especially when I am using 1,2 and
4  (D, K, U) to set the requisite measurements for the scale bar.

m.

PS. BTW, the updater seems not to work properly from my connection at
least. I get a message saying "Image J Updater: Unable to open release
notes at http://rsb.info.nih.giv/ij/notes.html"

Rasband Wayne wrote:

>> I am using ImageJ to add a scale bar to JPEG files taken with a
>> digital camera. These are 2048x1536 pix images that are rendered as
>> 17.34 x 13 cm, 300 pix/in images (these data from Photoshop). When I
>> apply a scale bar to them in ImageJ and save them in Jpeg (at 100
>> quality) they become 2048x1536 pix images that are rendedreed at
>> 72.25x54.19 cm, i.e. 72 pix per inch (data also from Photoshop). This
>> is problematic because they are to go inserted as linked files in a
>> Word document and when I update the Word field to point to the new
>> images with the scale bars they blow up. Could anyone let me know if
>> there is an easy fix for this? Is there a global parameter that makes
>> Imagej save the Jpegs at 300 pix/inch? Thanks in advance
>
> Manuel,
>
> You do this in ImageJ 1.40d (attached) by setting the resolution to 300
> pixels per inch in Analyze>Set Scale.
>
> -wayne

--


=================================================================
Manuel Arroyo-Kalin, McBurney Geoarch. Lab, Dept. of Archaeology,
University of Cambridge, Downing Street, Cambridge CB2 3DZ, UK

Homepage: http://www.arch.cam.ac.uk/~maa27

DL WAC Session: http://www.ucd.ie/wac-6/programme/237.html
DE WAC Session: http://www.ucd.ie/wac-6/programme/148.html

=================================================================