Go Back   Steve's Digicams Forums > Software > Resizing / Interpolation

Reply
 
Thread Tools Search this Thread
Old Aug 16, 2006, 11:27 AM   #1
Junior Member
 
Join Date: Jun 2006
Posts: 8
Default

Hi

I have been taking photos at highest quality JPEGS, as the processing time is much shorter than using TIFF. The photos that are saved in my camera, are saved at 8MP, with a setting of 96dpi.

I am looking to amend the 96dpi number to 300dpi (without actually resampling the photo). This would allow me to open up the photos in FreeHand at the correct size for printing. At the moment they open up far to large and I have to resize the images manually.

However I have not been able to find a program which will do this and resave the JPEG lossless. Seeing as the image itself isn't been changed, just the dpi number, it must be possible to create a lossless program/function to do this.

There are plenty of programs which offer lossless rotations, and that requires the image pixels to be moved.

I am not a programmer myself so I can't create such a program. I am hoping someone else has. I've not found anything on the internet so far which will do the job.

Another reason I don't want to use TIFF is that it takes up a huge amount of disk space. A JPEG currently takes up 3-4MB, where as a LZW TIFF takes up 12-13MB.

Kind regards

Timothy Langner
timflang is offline   Reply With Quote
Sponsored Links
Old Aug 17, 2006, 11:13 PM   #2
Senior Member
 
Join Date: Jun 2005
Posts: 804
Default

Tim, I doubt that there would be any noticable image degradation from even a regular, lossy save-as. It takes multiple recompressions before you notice any difference.

On the technical side, is there any actual recompression going on in this case anyway? Resolution is stored as metadata, it isn't image information per se. If you just resaved (no save as) under a different resolution, is there still loss?

If you want to save in a lossless format without the file-size penalties of TIFF, have you considered archiving your pix in JPEG 2000? This can losslessly reduce the file size by more than 3X over the same image stored in TIFF using LZW compression.
Of course, JPEG 2000 is not widely in use, so it likely would only be good for your master copies. You'd still have to convert to a more conventional format for printing or sharing your pix with someone who doesn't have an editor/veiwer with JPEG 2000 compatibility.

Grant
granthagen is offline   Reply With Quote
Old Sep 6, 2006, 11:00 PM   #3
Junior Member
 
Join Date: Sep 2006
Posts: 4
Default

Most home photo editors don't have JPG 2000 formant. Are there any picture formants that will not lose any of the picture details. JPG lose some details but it hard to notice it. TIFF takes up a lot of space.
Emery is offline   Reply With Quote
Old Sep 7, 2006, 10:29 PM   #4
Senior Member
 
Join Date: Jun 2005
Posts: 804
Default

Emery, PNG (Portable Network Graphics) is lossless, compresses better than TIFF but not as good as JPEG, and is pretty standard on most editors.

I think that they have a free, stand-alone JPEG 2000 converter either on or through the JPEG website.

Grant
granthagen is offline   Reply With Quote
Old Sep 27, 2006, 10:33 PM   #5
Junior Member
 
Join Date: May 2005
Posts: 5
Default

Tim --

Yes, there are a few programs that will change the resolution parameter stored in the EXIF metadata. Do a search for EXIF utilities. In my case, I use "Downloader Pro" to import my digital photos, and it has a plugin that automatically updates the DPI setting to 300 for me.

You don't want to be using an image editing program to do this as you will end up decompressing and re-encoding the image which is (with very few exceptions) guaranteed to be a "lossy" operation.

Grant --

Yes, opening up the image, changing the metadata andresavingwill nearly always incur image degradation, even if you don't make any visual editsto the photo. The quantization tables used for compression in image editors never match the digicam's output and hence the problem. Any change to the file (metadata or otherwise), unless done in a "browser" (where the image isn't truly opened) is likely to trigger a recompression step.

There is very little value to converting your digital photos into a lossless format such as TIFF forarchiving, unless you are doing further edits. JPEG is a bad "editing" (intermediate) format, but as an end-product it's fine.

Cal
calvin is offline   Reply With Quote
Old Jul 11, 2009, 1:59 AM   #6
Junior Member
 
Join Date: Jul 2009
Location: Sydney
Posts: 1
Default Specifying DPI

I realise this is an old thread, but it still shows up in search engine results, and not having satisfactory answers to old questions is one of the infuriations of the internet!

There is a program called Downloader Pro by Breeze Systems which can set the DPI information on images as they are being imported from your memory card (or wherever), as well as do complex renaming and so on.

See: http://www.breezesys.com/Downloader/index.htm

I haven't yet sussed out an application for modifying existing files in-place, but if you look at the details of the JPEG/JFIF file format, you can see that there are some bytes in the header (the start of the file) that store these values, so it is entirely feasible to write a program that just changes those few bytes.

Taken from: http://www.fileformat.info/format/jpeg/egff.htm

Code:
typedef struct _JFIFHeader
{
  BYTE SOI[2];          /* 00h  Start of Image Marker     */
  BYTE APP0[2];         /* 02h  Application Use Marker    */
  BYTE Length[2];       /* 04h  Length of APP0 Field      */
  BYTE Identifier[5];   /* 06h  "JFIF" (zero terminated) Id String */
  BYTE Version[2];      /* 07h  JFIF Format Revision      */
  BYTE Units;           /* 09h  Units used for Resolution */
  BYTE Xdensity[2];     /* 0Ah  Horizontal Resolution     */
  BYTE Ydensity[2];     /* 0Ch  Vertical Resolution       */
  BYTE XThumbnail;      /* 0Eh  Horizontal Pixel Count    */
  BYTE YThumbnail;      /* 0Fh  Vertical Pixel Count      */
} JFIFHEAD;
Units, Xdensity, and Ydensity identify the unit of measurement used to describe the image resolution. Units may be 01h for dots per inch, 02h for dots per centimeter, or 00h for none (use measurement as pixel aspect ratio). Xdensity and Ydensity are the horizontal and vertical resolution of the image data, respectively. If the Units field value is 00h, the Xdensity and Ydensity fields will contain the pixel aspect ratio (Xdensity : Ydensity) rather than the image resolution. Because non-square pixels are discouraged for portability reasons, the Xdensity and Ydensity values normally equal 1 when the Units value is 0.

So.. what you want is your incoming/original JPEG file doctored with the following values. Note that 300 (decimal) is equal to 0x012C (hex).

File offset (in hex, starting at 00) : byte value (in hex)

0d : 01 -- units field, 01 for "dots per inch"
0e : 01 -- Xdensity high byte
0f : 2c -- Xdensity low byte
10 : 01 -- Ydensity high byte
11 : 2c -- Ydensity low byte

-spxl
subpixel is offline   Reply With Quote
Old Jul 11, 2009, 10:58 AM   #7
Senior Member
 
dwig's Avatar
 
Join Date: Feb 2005
Posts: 133
Default

Another note for those reading this old thread. The claim that PNG uses lossless compression is somewhat inaccurate. PNG is a very flexible format. It supports uncompressed, lossless compression, and lossy compression. Just because you save as PNG doesn't guarantee that compression will be lossless. You need to know what compression algorythm you application uses.

Secondly, when you open an image, the PPI that the application displays is not necessarily mean that that PPI is specified in the original file. Many images lack any PPI specification. When apps that "think" in terms of linear dimensions (inches, mm, ...) for their virtual documents (FreeHand, Adobe Illustrator, Quark Express, ...) they must fill in some default value for the missing PPI specification. Even most images editors do the same. The most common value to use is 72ppi (the default display resolution on older Macs), but some art and document production applications running on Windows use 96ppi which is the Windows default display resolution.

The importance of my second point here is that if you want to change or insert a 300ppi specification into the header of a file you can't rely of a binary search of that file to find the old value since it may not exist despite the fact that some value is displayed in an application such as FreeHand or Photoshop. In fact, in the OP's case his camera probably didn't specify a PPI in its JPEGs. 96ppi would be an unusual resolution for a camera to specify and is the default that Macromedia FreeHand for Windows uses when it encounters files without a specified PPI.

Last edited by dwig; Jul 11, 2009 at 11:12 AM.
dwig is offline   Reply With Quote
Old Sep 19, 2009, 6:00 PM   #8
Senior Member
 
Join Date: Aug 2009
Location: NYC
Posts: 1,990
Default

Quote:
Originally Posted by timflang View Post
Hi

I have been taking photos at highest quality JPEGS, as the processing time is much shorter than using TIFF. The photos that are saved in my camera, are saved at 8MP, with a setting of 96dpi.

I am looking to amend the 96dpi number to 300dpi (without actually resampling the photo). This would allow me to open up the photos in FreeHand at the correct size for printing. At the moment they open up far to large and I have to resize the images manually.

However I have not been able to find a program which will do this and resave the JPEG lossless. Seeing as the image itself isn't been changed, just the dpi number, it must be possible to create a lossless program/function to do this.

There are plenty of programs which offer lossless rotations, and that requires the image pixels to be moved.

I am not a programmer myself so I can't create such a program. I am hoping someone else has. I've not found anything on the internet so far which will do the job.

Another reason I don't want to use TIFF is that it takes up a huge amount of disk space. A JPEG currently takes up 3-4MB, where as a LZW TIFF takes up 12-13MB.

Kind regards

Timothy Langner
Your images are not being taken at 96 dpi. This is the default setting (or your setting) of the image processing program you are using. The only meaningful number of a file is the ppi of the width and the hight. So a 4288 by 2600 image is in terms of dpi, whatever you want it to be. Image processing programs have to use a working dpi, but that has No Effect on the actual image. If you can locate the settings on your image processing program, they images will be whatever dpi you want - no point in resaving the image.

Dave
Chato is offline   Reply With Quote
Old Sep 19, 2009, 9:34 PM   #9
Senior Member
 
dwig's Avatar
 
Join Date: Feb 2005
Posts: 133
Default

Quote:
Originally Posted by Chato View Post
Your images are not being taken at 96 dpi. ...
Its true that they are not "taken" at 96ppi but they may be saved with a 96ppi specification in the header. Programs like FreeHand will respect a PPI specification in a files header and place the image on their virtual page sized so that the effective resolution of the placed image matched the file specification. If it is then printed without further scaling in the app or in the print dialog the final on paper print will be at the specified resolution. This is a design feature that has existed since the birth of the TIFF format and followed by all good layout programs and most good image editors.

The fact that the OP was seeing the images import at 96ppi leads me to believe that his camera is not specifying any PPI in the image header. When no PPI is present, as is often the case with JPEG images, FreeHand on Windows defaults to the 96ppi that is the Windows display convention. On MacOS, it will default to 72ppi. Photoshop uses 72ppi on both platforms in such cases.

As long as the OP uses a utility that sets a specific PPI, 300ppi in his case, without searching for files with 96ppi first he'll get the results he's looking for. If he attempts to use a progam elegant enough to allow for searching for only those files with 96ppi and only altering those, perhaps to do a faster job, he will likely find that none are changed.
__________________
----
Dwig
dwig is offline   Reply With Quote
Old Sep 20, 2009, 11:19 AM   #10
Senior Member
 
Join Date: Aug 2009
Location: NYC
Posts: 1,990
Default

Quote:
Originally Posted by dwig View Post
Its true that they are not "taken" at 96ppi but they may be saved with a 96ppi specification in the header. Programs like FreeHand will respect a PPI specification in a files header and place the image on their virtual page sized so that the effective resolution of the placed image matched the file specification. If it is then printed without further scaling in the app or in the print dialog the final on paper print will be at the specified resolution. This is a design feature that has existed since the birth of the TIFF format and followed by all good layout programs and most good image editors.

The fact that the OP was seeing the images import at 96ppi leads me to believe that his camera is not specifying any PPI in the image header. When no PPI is present, as is often the case with JPEG images, FreeHand on Windows defaults to the 96ppi that is the Windows display convention. On MacOS, it will default to 72ppi. Photoshop uses 72ppi on both platforms in such cases.

As long as the OP uses a utility that sets a specific PPI, 300ppi in his case, without searching for files with 96ppi first he'll get the results he's looking for. If he attempts to use a progam elegant enough to allow for searching for only those files with 96ppi and only altering those, perhaps to do a faster job, he will likely find that none are changed.
While you are correct about the dpi getting tagged with the image, it still doesn't alter the actual size of the image.

I am always amused when I'm told by a service bureau that an image must be 300 dpi. In the Photoshop dialogue for resizing, if you click off the resample option, you will see that altering the dpi has no effect on the actual size of the image. For that matter, with that option off, changing the physical size of the image, has no effect, But the dpi will automatically get greater or smaller, depending on the new size.

While it might be convenient to alter a new loaded image, and give it a specific dpi, I never bother to do this, and would certainly not resave an image just for that purpose.

Dave
Chato is offline   Reply With Quote
 
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



All times are GMT -5. The time now is 2:58 PM.