Skip to main content
Inspiring
July 6, 2019
Answered

Need a basic reminder of how to scale images for export to different size files

  • July 6, 2019
  • 2 replies
  • 23016 views

I don't use AI all the time, but thought I understood the best way to scale an AI image for export.  But, following the technique, I'm getting some terrible quality export files.  If someone sees something I'm missing....

I started with a 640x640 pixel artboard.  No particular reason for the size choice.

The artboard contains 3 text entries, and an 8-point compass rose.  The rose was built using the star tool, and some triangles.  It ends up including 2 4-point stars, and 8 triangles used just for coloring.

The text entries are simple 2-3 word phrases.

After building the graphics and text, I selected all objects, and scaled them to 20%.  Created a new artboard, and collapsed it around the graphics (Object>Artboards).

I then export to PNG using the artboards.  With one named "100pct" and the other "20pct", the result of the export is the two files.

Given all the scaling appears to be vector objects, my expectation is the graphics in both files would be high quality.

But, when I place or insert the 20pct PNG image, it's quite grainy.

I actually get acceptable results by inserting the 100pct PNG image and then scaling it to 20%.  But there, I'm changing bit images, so the tolerance won't be much.

What am I doing wrong using the approach of scaling vector images into their own artboards.  Shouldn't I get equally good quality in each of the PNG files?

This topic has been closed for replies.
Correct answer Jacob Bugge

I've retested and am getting different dimensions of the images between the Export and the File>Save when inserted in a document.

The actual PNG files between the two techniques are close to the same size (pixel dimension), but the images inserted in a document (e.g. Word), are different.  The difference is about 74%, meaning the File>Save Web objects are about 74% of the Export ones once inserted in a document.

Is this the pixel density (e.g. 72 vs 300) warning you gave?

Since I'm assuming the File>Save for Web method has everything at 72ppi, the implication is I'm making the "mixed density" mistake in AI and/or during the Export.

Although I don't understand how this would be the issue, part of the vector graphics (the compass rose) was originally in a separate AI file.  I ended up copying the final AI graphics to a new AI file, and pasted it in AI format.  The 3 text entries that were added were in an artboard that may have been set to 72ppi, while the compass rose came from an AI file set for 300ppi.

Again, more testing....


Tom,

The actual PNG files between the two techniques are close to the same size (pixel dimension),

They ought to be exactly the same. The Save for Web is accurate, so any difference would be something strange in the Export.

but the images inserted in a document (e.g. Word), are different.  The difference is about 74%, meaning the File>Save Web objects are about 74% of the Export ones once inserted in a document.

As I had understood it (I have never had/used Word), an image is inserted at a certain size, and then you can scale, so I am afraid the reason is unknown to me.

Is this the pixel density (e.g. 72 vs 300) warning you gave?

The PPI issue tends to give itself away, by the proportions: going between 300 and 72 you get 0.4 (72/300) or 4.1667 (300/72).

Since I'm assuming the File>Save for Web method has everything at 72ppi, the implication is I'm making the "mixed density" mistake in AI and/or during the Export.

More accurately, with Save for Web you just work in pixels, but you are right in that it corresponds to 72 PPI, so you are probably right.

The 3 text entries that were added were in an artboard that may have been set to 72ppi, while the compass rose came from an AI file set for 300ppi.

There is no resolution setting in AI (apart from the Effect>Raster Effect Settings), and images just have the (original) pixel x pixel size they were created at, so their PPI will vary (wildly) inversely when scaled (wildly).

When you create a PNG, you have nice and orderly pixels with the right positions and colours.

If you halve the number of pixels (both ways), 4 pixels (2 x 2) turn into 1 which is the average colour of the 4, which has the same colour and (relative) position as if it had been made at half the size from the beginning, so nice and orderly pixels with the right positions and colours. The same applies at quarter and eighth size (multiple halvings).

All other resizings will make a mess where colours get mixed and muddled.

Hence the power of 2.

There is no reason to create a PNG at twice the size needed, but if you need a PNG both at a large size and at half/quarter/and so on size, you can just make the large one and use that for both/all sizes.

Also, are we avoiding any fractions just to keep things clean

If you mean fractions in positions/sizes, they give image borders with pixels made from mixtures of artwork and nothingness.

2 replies

Jacob Bugge
Community Expert
Community Expert
September 16, 2019

Tom,

 

With the new forums, all answers to anything but the OP (original post) are more difficult to make, Enter triggering its being sent, and they be threaded in the thread as you have already seen.

 

The safe way is to only use the blue Reply button at the top of the thread and then address the post so everyone can see whom it is for.

 

Since this thread has been threaded owing to its being transferred, I agree with Monika that a new thread would be a better way to continue.

 

Jacob Bugge
Community Expert
Community Expert
July 6, 2019

tdcarp,

It is important to have the images in the exact desired final pixel x pixel size, forget about resolution which may actually lead to wrong sizes and hence blurriness. It is easiest and safest to work at the desired size.

To get the same pixel x pixel size, Export at 72 PPI or use the Legacy Save for Web where you can check the image size in the Image Size window and see it even before doing it.

It is also important to have the artwork/Artboard placed fully within integer/whole pixel X and Y values in the Workspace. Otherwise the resulting image will become a bit wider/taller and the extension(s) will be empty and therefore be white.

Here is an overview of general advice that is as sound as it may be old fashioned, and it may also make it easier for you, especially if everything is pure vector artwork:

A very common unsuitable way is to Export to PNG (remember to use PNG24 and use Transparency for artwork to be in front of different backgrounds) with a medium or high resolution, such as 300PPI.

To retain the clean and crisp artwork, a PNG must be created at exactly the pixel x pixel size that it is to be used for (or second best at sizes that are powers of 2 times as large).

For clean and crisp artwork avoid JPEG.

Therefore, the safest way is to create the artwork at the final pixel x pixel size and use a corresponding Artboard, then either use the Legacity Save for Web (where you can look in the Image Size window for size confirmation) or Export at 72PPI. In either case, use the relevant optimization (available with both ways); it is also convenient to have 72PPI in the Effect>Document Raster Effect  Settings.

If you have pure vector artwork, you can relax a bit and have the artwork/Artboard at any size (the Artboard must have the same proportions as the final image), then use the Legacity Save for Web and set either Width or Height in the Image Size and Apply (make sure the other value is also correct).

The Legacy Save for Web may be an old carthorse, but it knows its way home, even if the driver is drunk and sleeping it off in the hay in the back.

tdcarpAuthor
Inspiring
July 7, 2019

Thanks Jacob

Assuming I understand correctly, the two approaches are:

Use multiple artboards, each with the original graphics, scaled to the desired output dimensions.  In my case, the scaling is 20% and 15% of the original artwork.  I then shrink the relevant artboard to the dimensions of the artwork.  Each of the artboard contents can be created by Use Artboards during the export.

The other technique, the one you describe, is to have one artboard, and scale when saved for web (I use CS5, so that's File>Save for Web & Devices...).  In the save window, PNG-24 and transparency are selected.  Scaling can be done via the Image Size window.

Assuming this is correct, I understand the appeal of using the File>Save for Web approach (only one artboard).

I've started testing each approach to see if there are any result differences, and have found the scaling sizes (pixel dimensions) to be different.  That doesn't make sense, so I'll repeat the tests and post again.  I also think I'm seeing quality differences between the two techniques, between the two techniques.  Again, that could be testing error.

I'm going to assume that vector scaling, whether via a Transform or via File>Save to Web, will be the same quality.

More to come...

Tom

Jacob Bugge
Community Expert
Community Expert
July 7, 2019

Tom,

Assuming this is correct, I understand the appeal of using the File>Save for Web approach (only one artboard).

I'm going to assume that vector scaling, whether via a Transform or via File>Save to Web, will be the same quality.

Twice indeed.

When you scale to some percentage, I believe you may quite easily end up with non integer sizes/positions.

It is nice to see the Safe for Web & Devices again (and also just Save for Web); I say Legacy Save for Web as default CC speak.