Nav: Home
Welcome, Guest. Please login or register.
Did you miss your activation email?
May 27, 2012, 01:46

Login with username, password and session length

MicrostockGroup

Microstockgroup Sponsors


« previous next »
Pages: [1] Print

Topic: scaling image down to specific PIXEL COUNT using photoshop  

(Read 1817 times)
Larry


« on: August 26, 2011, 18:25 »

When I want scale down an image to a particular number of pixels, I use a little spreadsheet I wrote.  It is cumbersome, I have to copy the existing image dimensions into the spreadsheet, then read the output pixel dimensions and transfer that back to the image/scale dialog. Then let photoshop scale the image and save it under a new name.

I would like to figure out how to tell photoshop to create a downscaled image with a given number of pixels, for example 10,000,000 if I need a 10 megapixel image to post. I cannot just enter a fixed dimension in the height and width boxes because all my images are a variety of shapes, so each one needs a different setting.  Then I could automate the thing pretty easily to do a whole raft of images at once.

Do not know how to do this, either by some windows automation, or photoshop special trick. Do you know how?
thank you


Ignore | Logged


DepositPhotos.com
sjlocke

iStock Gauge
« Reply #1 on: August 26, 2011, 18:40 »

What?  Use the PS image scale function to resize an image.


Ignore | Logged


Mantis
« Reply #2 on: August 26, 2011, 18:45 »

What?  Use the PS image scale function to resize an image.

But he wants to do it as a batch function with different size images if I understand correctly.  So I believe he wants multiple images of different sizes to "automatically" be brought up to one "global" size with a batch function.


Ignore | Logged


Larry


« Reply #3 on: August 26, 2011, 22:19 »

What?  Use the PS image scale function to resize an image.
Is that new, I only have seen image size. Then you have to type in the new horizontal and vertical dimension and let it go.  What I would like to do is specify the product of the horizontal and vertical dimensions, i.e. pixel area. This would be a constant for, for example, a 10 MP image, would be 10,000,000. Rather than setting the width and height to achieve that product. Due to the wide variety of image shapes I have doing the calculation is tedious. Thanks.


Ignore | Logged


patrick1958
« Reply #4 on: August 27, 2011, 01:57 »

Write an action in photoshop.  Batch processing can be started from within Bridge using the photoshop batch.

Patrick.


Ignore | Logged


Microbius
« Reply #5 on: August 27, 2011, 08:25 »

I know what you mean, I run into the same problem when trying to downsize my illustration jpegs for SS. I believe what the OP wants to be able to do is enter the number he wants pixel width X pixel height to equal.
This would make my life much easier too. At the moment you have to enter a number for either height or width, see what that changes the other side to, do the calculation and see if you are over or under the desired total (HXW) then adjust the guess and repeat. A huge PITA


Ignore | Logged


sjlocke

iStock Gauge
« Reply #6 on: August 27, 2011, 08:38 »

I have a PS script somewhere on my blog you could use.


Ignore | Logged


Microbius
« Reply #7 on: August 27, 2011, 08:49 »

awesome! I'll try and track it down.

ETA I found reference to a resize script on your site, but it doesn't sound like it does what was being discussed here (?)
« Last Edit: August 27, 2011, 08:55 by Microbius »

Ignore | Logged


sjlocke

iStock Gauge
« Reply #8 on: August 27, 2011, 09:52 »

You can type in a w or h and it will show number of pixels.


Ignore | Logged


Larry


« Reply #9 on: August 27, 2011, 10:20 »

Right. I have such an excel sheet. It calculates the horizontal and vertical dimensions the image needs to be scaled to, given the existing width and height, and target size in pixels.  That is not my problem. I need to basically do one of two things.
1. using windows automation, make photoshop talk to and listen to excel. I can handle the photoshop action part.
or
2. find a built-in Photoshop feature (it is likely there, but hidden) that knows about this stuff.


Ignore | Logged


Gannet77


iStock Gauge
« Reply #10 on: August 27, 2011, 13:46 »

In the days when Alamy required images to be upsized to 48MB uncompressed, there was a script that would do this automatically for you - it's gone now, but I still have a copy.

It has a variable set to 48 which is then converted to an absolute pixel count and does the appropriate conversion.  Not exactly what you're asking for perhaps, but I should think if you can do a little scripting you could easily convert it for your purpose.

I've put a copy here http://www.bullersofbuchan.me.uk/istockphoto/stuff/Alamy%20Resize.zip if you want to try it.


Ignore | Logged


Larry


« Reply #11 on: August 27, 2011, 15:03 »

In the days when Alamy required images to be upsized to 48MB uncompressed, there was a script that would do this automatically for you - it's gone now, but I still have a copy.

Wow.  I had no idea that Photoshop could deal with Javascript code. I done some javascript (for browsers of course) This should give me
something to dig in to. I appreciate your help !


Ignore | Logged


Gannet77


iStock Gauge
« Reply #12 on: August 27, 2011, 15:36 »

Sean's iStock resizing script should also be easily adaptable to do the sort of thing you want - it's the same principle as I recall, but has a pull-down menu to select specific sizes to suit iStock's XXXL, XXL, XL, L and M sizes.

He has it here http://digitalplanetdesign.com/index.php?page=istocktools
« Last Edit: August 27, 2011, 16:00 by Gannet77 »

Ignore | Logged


Microbius
« Reply #13 on: August 28, 2011, 10:18 »

In the days when Alamy required images to be upsized to 48MB uncompressed, there was a script that would do this automatically for you - it's gone now, but I still have a copy.

It has a variable set to 48 which is then converted to an absolute pixel count and does the appropriate conversion.  Not exactly what you're asking for perhaps, but I should think if you can do a little scripting you could easily convert it for your purpose.

I've put a copy here http://www.bullersofbuchan.me.uk/istockphoto/stuff/Alamy%20Resize.zip if you want to try it.


Okay worked out that what Photoshop calls "pixel dimensions" of 71.5 correspond to a total number of 25000000 pixels (5000X5000 pixel square image) which is the maximum size for a raster illustration on SS. So for my use I just changed the 48 to 71.5 in the script and it now does exactly what I wanted. Thanks!

Now can anyone explain what "pixel dimensions" in the PS "Image Size" pop up menu means? It sounds like it should be the result of height X width but it clearly isn't.


Ignore | Logged


Larry


« Reply #14 on: August 28, 2011, 16:01 »

In the days when Alamy required images to be upsized to 48MB uncompressed, there was a script that would do this automatically for you - it's gone now, but I still have a copy.

It has a variable set to 48 which is then converted to an absolute pixel count and does the appropriate conversion.  Not exactly what you're asking for perhaps, but I should think if you can do a little scripting you could easily convert it for your purpose.

I've put a copy here http://www.bullersofbuchan.me.uk/istockphoto/stuff/Alamy%20Resize.zip if you want to try it.


Okay worked out that what Photoshop calls "pixel dimensions" of 71.5 correspond to a total number of 25000000 pixels (5000X5000 pixel square image) which is the maximum size for a raster illustration on SS. So for my use I just changed the 48 to 71.5 in the script and it now does exactly what I wanted. Thanks!

Now can anyone explain what "pixel dimensions" in the PS "Image Size" pop up menu means? It sounds like it should be the result of height X width but it clearly isn't.



Hi. Yes, I just figured that out.  There is two factors in it, the use of 1024 x 1024 rather than 1000 x 1000 for the term 1 Meg. And the use of 3 bytes per pixel. When you peer into that script that was kindly provided, the author multiplies his desired size (TargetMb) by 1,024, by 1,024, then divides by 3.  (In memory, 24 bit images use three bytes of storage per pixel). And his term was Mb not MP.

So if you look at an image size, then do the same calculations, you will get the number that Photoshop rather mysteriously describes as pixel dimensions. They are describing memory use not image size.

For my use of the script, I just put my target size straight away into, 25 megapixel is 25000000, ditched the divide by 3 and set the new dimensions to  these factors:

target = 25000000;
(...get existing height and width..)
var aspectRatio=width/height;
var newHeight=Math.sqrt(target/aspectRatio);
var newWidth=newHeight*aspectRatio;

and this produces the desired image dimensions. (For worriers, these are in floating point figures, when you chop them to ints, then the overall
image size is alittle shy of what you want, so you have to jack around somewhat.

Huge thanks to Gannett, I am solving my file creation problems readily now.
« Last Edit: August 29, 2011, 09:19 by Larry »

Ignore | Logged


Microbius
« Reply #15 on: August 29, 2011, 01:46 »

Yeah thanks Gannet from me too and also to Larry for clearing up what pixel dimensions means in PS!


Ignore | Logged


Gannet77


iStock Gauge
« Reply #16 on: August 29, 2011, 04:23 »

You're welcome...  though acknowledgment is really due to Steve Smith at www.paw-print.com, who wrote the script originally.


Ignore | Logged


Envateo Photo ToolsMicrostock Insider
Pages: [1] Print 
« previous next »
Jump to:  


Related Topics
Subject Started by Replies Views Last post
Photoshop Tutorial - What to do with an underexposed image
Photoshop Discussion
rjmiz 0 1038 Last post June 04, 2007, 16:24
by rjmiz
How often do you do PIXEL MAPPING?
Cameras / Lenses
hali 1 1003 Last post November 22, 2008, 17:22
by stormchaser
Photoshop magazine want my image....need opinion? « 1 2 »
General Stock Discussion
cybernesco 37 3804 Last post February 12, 2009, 20:48
by cybernesco
Pixel quality issue
Veer
melastmohican 4 980 Last post January 22, 2010, 20:45
by studioportosabbia
problem with eps scaling
Illustration - General
archibald1221 4 880 Last post May 05, 2011, 15:26
by archibald1221

TinyPortal v1.0.5 beta 1© Bloc