# Exporting multiple sizes of the same image

I have generated an image using (for example)

out = Plot[x^2, {x, -2, 0}, PlotLegends -> {x^2}]


and would like to export two versions of that image, one that is 72 points wide and another that is 144 points wide (the numbers don't particularly matter). I have tried

Export[filename, out, ImageSize -> 72]


but that doesn't work - the exported image has the same size as the original one. (This is consistent with the documentation, which says [somewhat confusingly] that While ImageSize changes the display size of an image (on the screen), it does not affect the underlying dimensions (as reported by ImageDimensions). Functions useful for changing the actual dimensions of an Image object include ImageResize, ImageCrop, ImageTrim, and ImagePad. So I guess that makes sense.

Next I tried ImageResize:

Export[filename, ImageResize[out, 72]]


This failed because ImageResize is not applicable to the given object, since its head is Legended rather than Graphics.

Even if I remove the legend (which I really can't do given the application), the result of ImageResize is a very poor image:

Is there any way to automate the production of two different size of the same image? (By the way, I previously posted this question, which asked part of this question as well, and never really received an adequate answer.)

• r1=Show[out, ImageSize -> 100]; r2=Show[out, ImageSize -> 200]. Export both and you will see the difference in their file properties. – Hubble07 Dec 18 '15 at 19:05
• Umm...wow, do I feel like an idiot. Never thought of Show. That does indeed solve the problem. If you want to post that as an answer, I'll accept it. Thanks. – rogerl Dec 18 '15 at 19:30

The exporting can be automated using Table
sizeList = {100, 200, 300};