Fit Image off-by-one errors

SH
Posted By
Sean_Harding
Aug 16, 2004
Views
288
Replies
5
Status
Closed
I routinely need to take files from digital cameras and make them 300ppi 4×6" for proofing output. I need to automate this. Since the camera rotates vertical images, I need to do this in such a way that it works correctly for both vertical and horizontal images. I’ve been trying to do this with "fit image," but the size never quite works out the way I want.

A 4×6 300dpi image should be 1800x1200px. If I take the original file (3072x2048px in this case) and fit it to 1800px (both dimensions), I end up with a file that is 1800x1199px — 1 pixel too small on the short dimension. If I take the original file, change it to 300ppi (no resampling) in Image Size and then fit it to 1800px, I end up with a file that is 1800x1201px — 1 pixel too large on the short dimension. If I simply resize in Image Size to 4x6in 300ppi (with resampling), I get the expected 1800x1200px file, but that won’t work the same for both verticals and horizontals so it makes automation a pain.

When the image is 1 pixel bigger than I want, I could obviously just change the canvas size to chop off the extra pixel. But that feels like a hack around something that isn’t working right; I’d rather figure out what I’m doing wrong and fix it the right way. I also don’t want to end up doing that and then run the action on a file from another camera only to find out that the result was 1 pixel smaller instead of bigger.

What I’m doing right now to work around this is resizing based on percentage. However, that assumes that the input file will be a very specific size every time, and I don’t like to build that assumption into my actions if I don’t have to…

MacBook Pro 16” Mockups 🔥

– in 4 materials (clay versions included)

– 12 scenes

– 48 MacBook Pro 16″ mockups

– 6000 x 4500 px

SH
Sean_Harding
Aug 16, 2004
I’m still interested in the answer to why Fit Image isn’t producing the results I want. But I’ve solved the problem without figuring that out. I ended up just writing a JS script to do the right thing for different sizes and orientations.
EH
Ed_Hannigan
Aug 16, 2004
I wonder too. Tell me are you using CS or 7 or earlier? I have a theory but I may be all wet.

Are you going to post that javascript on the Adobe Studio Exchange?
SH
Sean_Harding
Aug 16, 2004
I’m using CS. I can post the Javascript, but it’s really simple (just checks if the width is greater than the height and then calls imageref.resize() with the appropriate parameters for the orientation).
R
Ram
Aug 16, 2004
Shaun,

In order to get from 3200 to 1800 pixels, the software has to multiply by a factor of 0.5859375 (or divide by a factor of 1.777777777777777777777777777777777777777777778). I’m speculating that you’re facing a rounding off somewhere.
8
8thNote
Aug 17, 2004
I occassionally have this problem as well. I have to convert 10" x 7.5", 300 PPI images to Presentation-ready 1024 x 768 px., 102.4 PPI. I have seen several images result in 1024 x 767 for unknown reasons. I found the problem for me was when I ran Fit Image: 1024 x 768 on images already of those dimensions.

How to Master Sharpening in Photoshop

Give your photos a professional finish with sharpening in Photoshop. Learn to enhance details, create contrast, and prepare your images for print, web, and social media.

Related Discussion Topics

Nice and short text about related topics in discussion sections