Forums > Digital Art and Retouching > Photoshop script sRGB psd to certain size MB Jpegs

Retoucher

SW Retouch

Posts: 26

Hello!

Does anyone have a script they can share with me or plug in they can direct me to that will save an sRGB psd to a certain MB of my choice JPEG?

Many thanks.

Jul 26 22 12:43 am Link

Model

Papro

Posts: 26

King of Prussia, Pennsylvania, US

no, you need to downsize the image by down-scaling it via image size. You can see preview size in mb as you change the percentage ratio-the dimensions or resolution-percentage based or number of pixels within a length to height ratio, as you lower it to reduce the number of pixels. Another means to reduce size is reducing the bit depth from 32, 16, to 8, but leave that at 16 and leave srgb alone, srgb has nothing to do with changing the size, its a color space, a sort of offciailized(solicialized but not based politically, it's based on company compatibility lets figure, sort of a tradition from company established popularity like the way we have 720p or full hd and now 4k rather than all the possible betweens. for color space-i suggest looking that up so you know the gamut differences between rgb, adobe rgb, srgb, and prophoto, along with bit depth and what they're intended for. it may save you time for me to also say rgb is addition color combination used for displays, it's for screens, its digital, while cmyk is subtraction color combination-meaning the computer calculates colors to produce color output for printers.

Jul 26 22 01:29 am Link

Model

Papro

Posts: 26

King of Prussia, Pennsylvania, US

the simple answer is the image size tab, there's no script, saving jpeg at a lower quality bypasses using image size but in today's image sizes that's rarely going to bring the size down to what you're trying to make it work for.
if you're uploading to model mayhem it needs to be super small, to do that you want to set the width to 1000px while retraining the ratio as a fixed ratio so the height stays proportional to width in dimension and pixels.
add a layer that is 100% transparent over the layer that is you image so when you save it as a jpeg it can prevent theft online-i don't know if that still works or to what extent but you can at least copyright or watermark it on the transparent layer-not 100% protected but worth doing if that's a concern. so the 1000px width is actually a good idea-just right for lowest resolution without noticeable quality loss online.
Also by the way, be careful with srgb as that is the colorspace your image is already saved as, so when you goto downsize it you want to be sure your working space is srgb and it saves as srgb which i think it does automatically-my CS6 does.

Jul 26 22 01:40 am Link

Photographer

LightDreams

Posts: 4457

Vancouver, British Columbia, Canada

SW Retouch wrote:
Hello!

Does anyone have a script they can share with me or plug in they can direct me to that will save an sRGB psd to a certain MB of my choice JPEG?

Many thanks.

Photoshop, as far as I can tell, does not offer a jpeg "save to a specific MB file size" option.  So you couldn't write an action for that as there's no such option to work with.  And, again from what I can tell, there's no way for a script to read the "tentative" output MB file size in photoshop for a specific Jpeg / quality compression level.   If someone knows of a way around that, then great!

As you are most likely aware, Photoshop does allow you to choose your Jpeg quality / compression level, instead.  But selecting a fixed jpeg quality / degree of compression level, does NOT result in a similar file size for all images.  I.E.  Setting a Jpeg quality / compression level of, say, 72%, might result in a 100K file size on one image and the same 72% setting might result in a 200K file size on the next image.

Doing it manually for ONE single image, is fairly easy.   As you adjust the quality level on your Photoshop "save file as" jpeg setting, it will tell you the resulting file size, so that you can change it accordingly.   Or if you want to automate it using the same compression / quality Jpeg level for various images (not the same resulting MB file size), that is also possible.

By the way, according to the Adobe forums, someone tried to write a script that basically had Photoshop save the same image file over and over again with various quality / compression levels, all in an attempt to get the desired file size range.   He said it was a mess.  The drive worked and worked for ages, on each individual file, all in an attempt to try and get one that was in the desired file size range.  He definitely did not recommend that approach.

So you might want to consider some kind of alternate solution.  If the final Jpeg output files really have to be in a similar MB file size range, then something that doesn't rely on a Photoshop Action or Script.

---

Somewhat related...

JpegMini is a great (paid) utility for getting the maximum image quality with the minimum file sizes for each individual image. Again, each image will be a completely different final file size, but it's great for when you just want the smallest file size possible for each individual image, before the image starts to visibly degrade due to the amount of image compression.

It's especially useful for photography websites, as you're constantly trying to walk that fine line between maximum image quality and minimum file sizes (for website speed).


P.S.  JpegMini also has some more expensive / very advanced website server conversion offerings (running in real time on websites converting uploaded jpeg files) that will allow you to specify all sorts of settings including final jpeg output file sizes.  But that's not part of the typical end user applications or plug-ins that they offer.  We're talking high end image handling website server setups that are in quite a different league...

Jul 26 22 10:42 am Link

Photographer

LightDreams

Posts: 4457

Vancouver, British Columbia, Canada

If a Photoshop Action or Script won't do it, maybe someone knows of a Photoshop Plug-in that will let you specify the jpeg output MB file size?   Or a stand alone program to run a batch of images where you could specify the same thing?  Or...?

Jul 26 22 02:17 pm Link

Photographer

AE Photography

Posts: 216

Quartzsite, Arizona, US

LightDreams wrote:
If a Photoshop Action or Script won't do it, maybe someone knows of a Photoshop Plug-in that will let you specify the jpeg output MB file size?   Or a stand alone program to run a batch of images where you could specify the same thing?  Or...?

I use an online resizer for all my image size reduction: https://www.simpleimageresizer.com/

Jul 28 22 12:04 pm Link

Photographer

Pictures of Life

Posts: 792

Spokane, Washington, US

LightDreams wrote:
If a Photoshop Action or Script won't do it, maybe someone knows of a Photoshop Plug-in that will let you specify the jpeg output MB file size?   Or a stand alone program to run a batch of images where you could specify the same thing?  Or...?

Disclaimer -      I use stand alone PS with Adobe Camera Raw, ACR essentially functioning as a plug in.  I don't know how the Cloud versions work.  ACR is the window that opens for all images files except PSD/PDD when using Photoshop; you don't have to add/install it, it's already there on the stand alone version.
    ACR can do a lot.  If you open PS and drag image files in, multiple jpegs, ACR opens and at the bottom it tells how it will open the files, sRGB 16bit etc.  If you click on that text, you can change how the file gets opened.  You can choose different pixels, usually multiples of 1024, which seems to be designed for internet saving, change to 8bit.  Then click the bottom left, Save Image, which lets you rename, or add to the original name, choose where to save, and choose quality level.  When done saving, click Cancel, and the files never open in PS, but are saved. Just add one letter to the beginning of the file name and you can sort them with no wasted time.
  You can do this as a batch edit, 10-20 or more at a time if you babysit, and check each file to make sure it's what you want; Select All to start, and before you Save Images.  (If it says 'Save Image' you only have 1 file selected, make sure it says 'Save Images', Select All first.) It's helpful to do landscape crops separate from portrait crops.
   It may not be the best program for resizing, changing quality, renaming, re-saving, but it works well.  If you Open in PS, the open settings sometimes get saved and applied the next time, so don't Open; Save Images then Cancel.
   If someone knows how to do this with the Cloud version, please post.

Jul 30 22 07:24 pm Link