Copy link to clipboard
Copied
Is it possible script resizing images (down) to specific file sizes? For example, just as a sample, I have a folder with a 150mb, 100mb and 75mb image (different images). And I want different file size versions of each image... so with the 150mb file the script would create a 100mb, 75mb, 50mb, 30mb, 20mb and 10mb version... with the 100mb file the script would create 75mb, 50mb, 30mb, 20mb and 10mb version and with the 75mb file the script would make the 50mb, 30mb, 20mb 10mb versions.
So basically I want to end up with images resized down to set mb sizes and not resized to set pixel sizes.
Thanks, Tim
Copy link to clipboard
Copied
There is no easy way to do this, you would need to save the file, check it's size, if it's too big resave as a lower quality.
The size of files you are talking about do not seem to be JPEG, so the only way you could reduce, PDF, PSD, TIF etc would be to reduce the document dimentions.
I do not think it is a viable option doing this.
Copy link to clipboard
Copied
Care to elaborate on the file format you are talking about?
And, to be blunt, whatever good is this supposed to be?
Copy link to clipboard
Copied
Yes, our file formats are JPEG. Most are around the 75mb mark but we do have some larger ones. Basically our service is an automated online web2print service and some of the images are large as there can be smaller crops into portions of the image, and they have to be able to print on our products that vary very much in size. This is leading to some long PDF/render times from our Indesign server and we are getting these times down. A big saving is to have the same images at various sizes so our system picks up the closest image size before making a PDF... in testing there is big savings in rendering time if you have a few images on a product and the sizes when downsampled are in the 5- 20mb range, then it's much faster having jpegs already around that size so not much resizing is going on, rather than Indesign server having to go to images that are 75mb, 100mb, 150mb and downsampling to 5, 10 or 20mb. Anyhow, it is looking at this stage we will get Imagemagik to do the resizing task.
Thanks, T
Copy link to clipboard
Copied
The time-savings regarding down-sampling can of course be relavant.
But I think it is not the size the image has on disk that should be considered but the effective resolution in Indesign.
Copy link to clipboard
Copied
Yep, but our stock images are being used numurous times with different crops at different sizes across thousands of products, so we can't keep a library of images suiting every effective resolution. Our best bet is to have a predetermined range of set image size per image and let the system/code downsample the closest above what would be 300dpi... so let's say we have an image with 100mb, 75mb, 50mb, 25mb and 10mb versions and in one of our products they respectively have effective resolutions on our product of 600dpi, 450dpi, 350dpi, 250dpi and 150dpi... then our system would pick up the 50mb/effective 350dpi version and downsample that to 300dpi... rather than picking up the original size 100mb/effective 600dpi version... it will render quicker that way. It will never choose the 25mb or 10mb in that example as they are below 300dpi effective resolution in the first place and we will never have our system pick those files in this instance.
Copy link to clipboard
Copied
But wouldn’t it make more sense to simply create the different resolution-versions (maybe even sharpen them again at the new pixel dimensions) instead of even considering how many MB they are?
Copy link to clipboard
Copied
So you are saying have a correct resolution version pre-made for each product that image is used in, so when a customer does choose that product it's ready and there is no resizing needed to be done as such when it comes to making the PDF in our system.
That would be nice, but we have 23,000+ images used 14,000,000+ times across 1,500,000+ products. So that would be an explosion of data storage required.
Copy link to clipboard
Copied
So you are saying have a correct resolution version pre-made for each product that image is used in
No, but I suspect you are (possibly deliberately) misunderstanding me.
Creating six versions with specific filesizes (and either varying resolution, pixel dimensions, quality, …) seems to offer limited benefits over creating a similar or somewhat smaller number of versions with specific resolutions.
Then again maybe I misunderstood you and you never meant the size on disk but the uncompressed size.
Copy link to clipboard
Copied
Yes sorry, I did mean uncompressed size. So the different mb sizes would have different resolutions, so there would be an image with resolution relatively to what is actually needed.
Copy link to clipboard
Copied
Sorry, then we have been on the same side of the issue anyway …
Copy link to clipboard
Copied
No worries, can happen quite often when not discussing face-to-face. Especially using terms in a subject such as this, like file size being applied in different ways.
Copy link to clipboard
Copied
But it should (edit) affect the feasability of the intended procedure.
Saving several downsampled copies off of a master file should not be a big problem.
Copy link to clipboard
Copied
talltim1, I have a couple of questions regarding this… forget file size (mb) that has nothing to do with this question… you basically just want several effective resolutions of images… What settings are you using when you export from id server (i don't have this btw just regular id user)… only given the list you've stated they appear close enough that you could turn image sub-sampling off? (that may speed things up). A standard 300dip press export would not downsample images until above 450dpi do you really have to trim to 300dpi? You say you have 23k images but you want possibly upto 5 resolution options… You are going to have a data explosion anyhows aren't you? Sure you could do peeremptive image processing quite easy but it still needs processing what is going to do this…? (i would think it will take a while). I think we need some more info about your routine but you first question was misleading… I've yet to see an example of script calculate *.jpeg file size (mb)
Copy link to clipboard
Copied
I am still not clear if the size in mb is the open document size. If so and the image is a RGB with a single background layer I have some code that will resize to an open document size in mb( or at least very close, if you request 100mb the size will be as close as it can get without changing the apsect ratio.
Copy link to clipboard
Copied
Mike, I would be very concerned if these were *.jpeg files and that 100mb was NOT the open/uncompressed data size…? Im guessing that the OP wants a routine that opens images and resamples based on pixel width x height… I'm however skeptical that all the resizes are required though…
Copy link to clipboard
Copied
I'm however skeptical that all the resizes are required though…
In one of the posts the OP explained (if I understood correctly) that the intent is to switch in the images closest to the effective resolution in Indesign-documents via an Indesign-server to save on exporting time when downsampling in the export.
With high volume this may be a considerable savings.
Copy link to clipboard
Copied
Yes, the more seconds we can knock off exporting time the better. In tests we are able to bring a render down from 16-20 seconds to 8 seconds by having more images closer to the size needed. Our traffic is increasing and our Indesign servers can take it easily at the moment, but we need to be prepared, especially for peak times such as USA and European business hours crossing. Trust me, for us it will cost a hell of a lot less to have more images stored hanging off the Indesign servers than to licence more Indesign Servers.
Most of our images are around 75mb (uncompressed) but some are 100-500mb (uncompressed) as various smaller crops can be used from these or the whole image could be used depending how the customer crops it on the product in their browser. Thanks for all the input, but it seems our developers are going to use Imagmagik to do this task.
Regards, Tim
Find more inspiration, events, and resources on the new Adobe Community
Explore Now