I have been using PhotoshopCS3 to resize images but I would to like to automate that part of the process. Most of our clients don’t supply images correctly. Our size requirements for images are 3" width x 2" height at a minimum of 266 dpi for printing. I was thinking to use Image Events but there no interface to deal with & also Image Events works image dimension as pixels. I don’t like to work with pixels dimensions & I use inches because is what I need. I know an image 3"x2" @ 266 =798x532 pixels. Sometimes depending on the image I resample images in Phothoshop. For example if the image is 42.667 x 32 inches at 72 dpi I uncheck resample & I change de image dimensions to 3" wide & the height will be 2.25" & the resolution is now 1024 dpi. Now I need change the resolution to 300 dpi to make the file size smaller so I check resample & I change the resolution to 300 dpi. I don’t what is the best way to achieve what I want. Writting a photshop script to resize iamge or using Image events. Any suggestions?
I recommend Image Events for what you’re doing… since you do in fact have a target width & height in pixels (798 * 532) - you can tell Image Events to sample down images that are larger than your target. “Pixels per inch” is meaningless when dealing with images in the digital realm - inches don’t exist until you try to print something.
Thank you for quick response misterfriendly,
The problem is pixel per inch is important when the images are going to be used for printing. If the picture is 19.889" x11.806" @ 72 ppi which is 1432x850 in pixels & then I tell Image Events to resize it proportionally to 798 pixels wide keeping the same ppi which is this 72 ppi the new size dimensions are 11.083" x 6.579 at 72 ppi. The only way I can see this working if I’m able to change the ppi first & then the pixels dimensions.
In my experience if your images are intended for the print/press environment then Photoshop is the better tool for the job. There are a multitude of things that can affect your output that are better dealt with by this app. I don’t have CS3 so I don’t know if the resize bug is fixed but in CS2 you would be working in pixels.
All that matters is that your images have an adequate number of pixels for whatever you’re using them for. If your customers are giving you images that are too small (ie, smaller than your minimum pixel dimensions) then they will of course look crummy when printed and you will have limited success sampling the images up (adding pixels). Photoshop is the thing to use in this instance, though of course the quality of the result will depend on the image.
The ‘Image Size’ setting in Photoshop can be confusing because it lets you enter your target measurement in pixels or ppi or both. But it’s doing the same thing no matter what - interpolating or discarding pixels. Unless you uncheck ‘resample image’ in which case it does nothing to the pixels, just changes the ppi setting which is essentially an arbitrary number until you print the image or place it in a page layout.
If you want an easy and automatic way to convert all images to the same pixel dimensions (or to rasterize PDF files to a given set of pixel dimensions) an Image Events script will work just fine with less system overhead than Photoshop.
misterfriendly,
My images are intended for printing & the final size needs to be aprox. (900x600) 3" x 2" @ minimum of 266 ppi & a max of 300 ppi. I decided to give it a shot to image Events. I found this script in Apple’s site that uses Image Events and resizes to shortest side of an image to be a specific length.
set this_file to choose file without invisibles
set the target_length to 600
--horizontal images 900 W x 600 H pixels = 3"x2"
try
tell application "Image Events"
-- start the Image Events application
launch
-- open the image file
set this_image to open this_file
-- get dimensions of the image
copy dimensions of this_image to {W, H}
-- determine the shortest side and then
-- calculate the new length for the longer side
if W is less than H then
set the scale_length to (H * target_length) / W
set the scale_length to round scale_length rounding as taught in school
else
set the scale_length to (W * target_length) / H
set the scale_length to round scale_length rounding as taught in school
end if
-- perform action
scale this_image to size scale_length
-- save the changes
save this_image with icon
-- purge the open image data
close this_image
end tell
on error error_message
display dialog error_message
end try
I’m getting an error “Can’t get item 1 of {}.”
Since I got that error I used Photoshop Fit Image… & specified an amount of 900 pixels. I did not obtained the results I was looking for. Yes, Photoshop resized all the images to 900 pixels. But the ppi was a key factor.
I trying my best to understand that the best thing is resizing in pixels forget about the ppi but it’s not working for my purposes.
If I do this in the manual way using Image size, resampling, change the width to 3" & then placed the images in Quark it works. We have a Quark template with lots pictures boxes sized 3 x 2". If you have to repeat the same process with 1,000 images with diffrerent sizes, ppi’s is not fun at all:(
How can I achieve what I need?
Hi
Not sure if this helps but this converts a image in Photoshop to the sizes you require:
tell application "Adobe Photoshop CS"
activate
set display dialogs to never
set thisdoc to current document
tell thisdoc
resize image width inches 3 height inches 2 resolution 266.0 resample method bicubic
end tell
end tell
I don’t have CS3 so not sure if the syntax has changed. if it works and is what you want then all you need to do is
add the repeat loops etc. to get it to work how you want.
What do you want to do with images that are smaller than your requirements upsample or are they always too big? what do you want to do if the proportions either landscape or portrait exceed your 3 x 2 crop or leave?
that Image Events script worked fine for me … where do you get the error?
Mark67
What do you want to do with images that are smaller than your requirements upsample or are they always too big? what do you want to do if the proportions either landscape or portrait exceed your 3 x 2 crop or leave?
Images thar are smaller & don’t fit our requirements for printing I reject them. I want to resize image dimensions & not pixels. I ONLY resample images when the ppi is more 300 to make file size smaller. If the image is portrait then minimum width is 2". I do understand that Image Events great tool for resampling images because you are changing pixels & it doesn’t care what dpi or ppi is but I’m my case is not what I’m looking for.
Once I resized the images to the size I want them, I run a set photshop actions that saves in different file formats & folder locations and eventually they are placed into Quark document with pictures boxes sized to 3"w x 2" h. To answer my own question I need to find a photoshop script that will do this for me.
Thank you Mark67, pidge1, misterfriendly
I’ve been working with a similar script for converting PDFs to Tiff, but whenever I run a PDF through Image Events, it kicks it out at 150DPI. Any ideas how I can fix that?
Before I was running them through Photoshop and had no problem making them 300 DPI. These are for print so 300 DPI is important.
I don’t know if this will be helpful, it certainly isn’t a timely response to your post! But I stumbled on your post while having a similar issue with image resizing in PS3. In my case, the solution ended up being the manipulation of the resolution variable only. This was the only way I was able to resize an image while setting resample to none (yes, I truly needed a resolution of 225.455!). Anytime I tried to alter height or width, I’d get the same error you were seeing initially. I don’t need to accommodate different image sizes, they are all standardized, but I would imagine you could easily calculate the resolution setting you would need based on the width and height of the image. Here was the line of code within my PS3 subroutine that worked for me. I hope it helps others that encounter this Adobe flub in PS3.
tell docRef
resize image docRef resolution 225.455 resample method none
end tell