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 10, 2019

Jacob, thanks for sticking with this.  It's exactly what I'm looking for.  I'm starting my testing from the beginning of the workflow, showing the guidance for each step, and why it's relevant.

The output for the test graphics is print, so I started by specifying the new AI file raster graphics as 300ppi.  Although I have no raster in the image, it appears this setting will have no other affect on the output, and will be there in case raster is added to the graphics later.  This value can be changed via a menu command after the file is created.

There's also a color setting, which I set as CYMK, given the print destination.  [Not sure what the guidance would be, other than use CYMK for print and RGB for web.  Haven't thought through "why", other than the windows in AI used for color settings will show in the selected version.  In the case of the test, if the graphics are displayed, there will be a color shift.]

The next decision is dimension.  The guidance is to make the graphic dimensions the same as the output dimensions.  The only question here is whether the guidance means the artboard dimensions should be set to the output dimensions.  I'm kinda hoping the answer is that the artboard dimensions may not matter, but the graphics dimensions do.  What I ended up doing for testing is to make the artboard about double the size of the graphics.  Before finalizing the graphics, I either reset the artboard to the graphics dimensions, or have the output created using the graphics dimensions.

There are actually 2 files: one is the final graphics, and the other the compass rose.  I use Place to insert the compass rose in the final graphics.  Am I correct that, Placing an AI object in another AI object still maintains the vector scaling?

One last issue that has come up is the rulers.  I am using inches as the measure of the output dimensions (i.e. 2" wide), and when the ruler is set to inches, things are as expected.  I noticed while testing that, if I change the ruler unit to pixels, AI uses 72ppi as the conversion rate.  Is the ppi setting for the ruler something that can be set, or, is the guidance to stay in the units being used for the output dimensions?

More to come.  This is turning out to be a good tread, so part of my intent is to leave context of using the guidance.

Thanks again...


Tom,

There's also a color setting, which I set as CYMK, given the print destination.  [Not sure what the guidance would be, other than use CYMK for print and RGB for web.

Certainly CMYK/CYMK (the former abbreviation being more common) for print, RGB for web, and starting in CMYK whenever both are used, very much owing to the difference in gamut.

CMYK color model - Wikipedia

RGB color model - Wikipedia

And then there is colour management; you can start on something about it here:

http://help.adobe.com/en_US/creativesuite/cs/using/WS52323996-D045-437d-BD45-04955E987DFB. html

https://helpx.adobe.com/illustrator/using/printing-color-management.html

http://www.computer-darkroom.com/

The last one with its links is a bit wider (and deeper, I believe).

Am I correct that, Placing an AI object in another AI object still maintains the vector scaling?

If you mean from document to document, always use Copy Paste (Ctrl/Cmd+C, then Ctrl/Cmd+F or V or B depending on where you want it): placing gives you the PDF equivalent which is vector/scalable but may very well be lacking in other ways depending on the artwork.

I noticed while testing that, if I change the ruler unit to pixels, AI uses 72ppi as the conversion rate.  Is the ppi setting for the ruler something that can be set, or, is the guidance to stay in the units being used for the output dimensions?

Illy (job description Adobe Illustrator) counts pixels as a(n actual) unit exactly equalling points, 1 pt/px = 1/72 in. So no way round it.

This causes confusion between this and of the general concept of pixels as the (smallest possible) area of a certain colour in a raster image (usually square but it can be taller or wider), the latter having no actual/specific size but changing with the actual size of the whole raster image (the PPI being changed inversely with the actual size).