Page 1 of 1

Resize image by file dimension

Posted: Thu Aug 25, 2011 10:11 am
by lglmrc
Hello,
I'm wondering if it is possible to resize an image by its file size with Extendscript?

For example:
my original image is a .psd file with this dimension: 11.985.384 bytes
I want to scale it down to, let's say, this dimension: 5.000.000 bytes

Is this possible?

I mean: does exist any sintax in Extendscript that refers to the bytes or something similar?

I use Photoshop CS3, but I think the sintax may be the same also for CS5

Any suggestions would be much appreciated
Thanks in advance

Resize image by file dimension

Posted: Thu Aug 25, 2011 4:41 pm
by xbytor
You would have to save it as a jpg or some other file format that has lossy compression.
Even then, you would have to iterate over jpeg quality levels until you found one
that gave you the desired file size. Several of us have implemented this over the years
and you may be able to find an implementation on this site somewhere.

-X

Resize image by file dimension

Posted: Thu Aug 25, 2011 5:37 pm
by txuku
Bonjour

Or - in psd format - reducing the size of the work incrementally ?