MicrostockGroup Sponsors


Author Topic: scaling image down to specific PIXEL COUNT using photoshop  (Read 10645 times)

0 Members and 1 Guest are viewing this topic.

« on: August 26, 2011, 18:25 »
0
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


« Reply #1 on: August 26, 2011, 18:40 »
0
What?  Use the PS image scale function to resize an image.

« Reply #2 on: August 26, 2011, 18:45 »
0
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.

« Reply #3 on: August 26, 2011, 22:19 »
0
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.

« Reply #4 on: August 27, 2011, 01:57 »
0
Write an action in photoshop.  Batch processing can be started from within Bridge using the photoshop batch.

Patrick.

Microbius

« Reply #5 on: August 27, 2011, 08:25 »
0
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

« Reply #6 on: August 27, 2011, 08:38 »
0
I have a PS script somewhere on my blog you could use.

Microbius

« Reply #7 on: August 27, 2011, 08:49 »
0
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 »

« Reply #8 on: August 27, 2011, 09:52 »
0
You can type in a w or h and it will show number of pixels.

« Reply #9 on: August 27, 2011, 10:20 »
0
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.

« Reply #10 on: August 27, 2011, 13:46 »
0
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.

« Reply #11 on: August 27, 2011, 15:03 »
0
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 !

« Reply #12 on: August 27, 2011, 15:36 »
0
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 »

Microbius

« Reply #13 on: August 28, 2011, 10:18 »
0
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.

« Reply #14 on: August 28, 2011, 16:01 »
0
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 »

Microbius

« Reply #15 on: August 29, 2011, 01:46 »
0
Yeah thanks Gannet from me too and also to Larry for clearing up what pixel dimensions means in PS!

« Reply #16 on: August 29, 2011, 04:23 »
0
You're welcome...  though acknowledgment is really due to Steve Smith at www.paw-print.com, who wrote the script originally.


 

Related Topics

  Subject / Started by Replies Last post
1 Replies
3812 Views
Last post November 22, 2008, 17:22
by stormchaser
4 Replies
5093 Views
Last post May 05, 2011, 15:26
by archibald1221
20 Replies
3939 Views
Last post April 21, 2013, 07:57
by jbarber873
1 Replies
3497 Views
Last post February 25, 2014, 05:36
by bunhill
1 Replies
1974 Views
Last post October 14, 2016, 05:01
by ShadySue

Sponsors

Mega Bundle of 5,900+ Professional Lightroom Presets

Microstock Poll Results

Sponsors