Skip to main content
Participating Frequently
May 12, 2016
Question

Save For Web Image Size settings

  • May 12, 2016
  • 2 replies
  • 3851 views

Hi folks,

This is currently driving me mad.

Is there any way of accessing the Image options in Save For Web via script????

I need to be able to manipulate the following:

Image Size Percent:

Image Size Quality:

I've looked everywhere, trawled through the api and can't find any information.

My workaround is to use an action to resize the image and then run a script to ExportOptionsSaveForWeb() but this always results in a larger file size and, for some unknown reason, an image that is 1px up and to the left.

I do not get this issue when running this same process manually with exactly the same settings.

Any help?

This topic has been closed for replies.

2 replies

Known Participant
August 10, 2016

IMO Photoshops' image compression tools aren't very good, maybe you can achieve something externally. I would recommend exporting as a high quality jpg (or png if you need transparency or are working with flat colors) at the exact resolution you need them to appear, then using a tool like https://tinypng.com/ or WP- smush. You'll end up with smaller images that look better than what photoshop can achieve.

JJMack
Community Expert
Community Expert
May 12, 2016

File size is not predictable. How well an image will compress depends on how much fine detail you have for an image   An image x pixels wide by y pixels high  saves as a high quality jpeg image can be as small as 200KB to as large as 7MB depends on image content.

JJMack
Participating Frequently
May 12, 2016

Hi JJMack,

For the images I'm working on we have a master image created from a manual export.

I localise these images x 50. If I export each 1x version manually it is always around the same size in bytes.

Trying to script this exact process I always end up with an image that's a large files size and has a slight deviation in layout.

The only thing that changes from using scripts and using the manual process is changing the image size to 50% in the Save For Web window and that appears to be messing things up hence why I want to know if this can be accessed using javascript to run some tests and hopefully export images of the same quality, layout and file size.

JJMack
Community Expert
Community Expert
May 12, 2016

Hi JJMack,

That's the whole point. I do not want to be using actions for anything. They're legacy and they are causing the issues.

Hence why I asked if there was any way of utilising the options in the Save for web dialogue.

Specifically:

Image Size Percent:

Image Size Quality:

If it can't be done then that's incredibly frustrating and I have no idea why Adobe wouldn't enable that.


nickc97991501 wrote:

Hi JJMack,

Save for web dialogue.

Image Size Percent:

Image Size Quality:

From my point of View (IMO)

"Save for Web" You use save for web to strip metadata and creating animated gif  (yes it can do other things that other features can also do so what.)

Image Resize can be done to ways  changing resolution and by interpolation.   Changing resolution is only valid for printing for web display devices do not use image files resolution setting. They display images at the resolution they are run at.  The number of pixels you have for images is what is important for the web.  You normally have to interpolate images for the web.

Anytime you interpolate an image you loose some image quality.   When you downsize you through away detail you have for your image. When you upsize you creating details for the image you do not have.  After the resize you have a totally new image not a single pixel you had for the original image exist.

How much quality you loose depends on many things.  The quality of the original pixels,  The size change percent, and the image content.  In a general case resize you need to use an interpolation method that works well on all images not a particular type of image.

Jpeg format uses  lossy compression which means when you decode a jpeg image you do not have the same image the you compressed.  Sill with my old eyes I can not see any difference between a quality 10 jpeg image and a quality 12 jpeg image and the quality 10 file size is much smaller the the quality 12 file size.

I do not understand why you require the large image  width and height to have a even number of pixels.    I would think you would be More interested in a particular size image for the web. Ones that would be fitted to some size pixel area.   Also if you use save as instead of Save for web you should convert image to the sRGB color space.

Resize is easy in scripting.

JJMack