Resize Image in Photoshop
Resize Image in Photoshop
- Subject: Resize Image in Photoshop
- From: "Fleisher, Ken" <email@hidden>
- Date: Mon, 06 Aug 2007 15:33:13 -0400
- Thread-topic: Resize Image in Photoshop
Title: Resize Image in Photoshop
Hello. I’m trying to resize an image to 20 MB in Photoshop CS2. My goal is to keep the same width and height (in inches) and alter the resolution. I can get it to resize to 20 MB if I set the resolution, but when I try to set the resample method to none, I get the following error:
"Adobe Photoshop CS2 got an error: You may use pixels to specify 'height' and 'width' only when resampling"
But since I changed the units back to inches again, I don’t understand why this doesn’t work. Any ideas?
Thanks!
Ken
-- ========================
-- Create and save the 20 Mb file
-- ========================
tell application "Adobe Photoshop CS2"
set doc20 to current document
-- Resize to 20 Mb
set oldUnits to ruler units of settings
set ruler units of settings to pixel units
tell doc20
set {w, h} to {width, height}
-- newWidth is calculated based on the following formulas
-- 20Mb = ( 3 * (prct*w) * (prct*h) ) / 1024^2
-- newWidth = prct * w
set newWidth to ((20971520 / (w * h * 3)) ^ 0.5) * w
end tell
resize image doc20 width newWidth resolution 300 resample method bicubic sharper -- Works up to here
set ruler units of settings to inch units
resize image doc20 width oldWidth resample method none -- Errors on this line
set ruler units of settings to oldUnits
end tell
--
Ken Fleisher
Photographer
Imaging & Visual Services
National Gallery of Art
Washington, D.C.
Phone: (202) 712-7471
email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden