Search code examples
androidpngexportandroid-imageadobe-illustrator

Which options to choose when exporting from Adobe Illustrator for .png for Android?


I am using Adobe Illustrator CS4 for creating images for launching icons to be used by Android applications. I create a set of images according to dev guide icon sizes for the ldpi, mdpi etc. The px is defined on the artboard but nothing about ppi/resolution on the vector graphics yet. When the image is finished I want to produce the .png files from each artboard which is configured to be the recommended size for the different densities. Adobe Illustrator has 2 options to produce a .png file; the first way is to do Save for Web & Devices which allows you to explicitly specify that you want a PNG-24 which Android requires but there is no mention for the dpi/ppi aspect of the image. The second way is Export which prompts a choice for the ppi of the image.

So the first method uses some automatic setting and the resulting images on the properties have same the number of pixels as was defined for the artboard in Illustrator. The second method's pixel numbers on the resulting .png change depending on the ppi chosen, and the equal corresponding pixel numbers from artboard to output .png arise only when ppi=72. So I conclude that the automatic Save for Web & Devices chooses 72ppi as well. In this question on SO, I asked about the ppi in Photoshop, and I was recommended to ignore the ppi.

Which route is the consistent one for exporting .png files to match the low, medium, high densities for Android? (eg. settings for the options)


Solution

  • True ppi is going to depend on the output device (screen, printer, PDF, etc). Unless you plan to render your images to PDFs or printed documents (it sounds like you're just doing launcher icons) I think you can safely ignore the ppi of the images themselves. You can take a look at this answer too.

    But if you're really worried, 72ppi will be fine.

    UPDATE I think that other post can help you out a little. Pixels-per-inch is a measure of density. But the image itself does not have a concept of density -- only of pixels. Where density comes into play is in the output device -- which can be anything, like I mentioned above. The challenge with Android is that screen sizes vary between all of the different devices on the market, and so a single image won't work on all of those different displays. Android addresses this problem with the h/m/i stuff. But in all cases, the system picks the best of the three sizes you provide, and then scales it to fit the particular device.

    So your best bet is just to provide three different sizes - h/m/i - for each image in your app. You have done that. But I don't think you need to worry about image density. If Photoshop/Illustrator/Whatever demands a value, I think 72ppi is fine, but unless I'm mistaken, won't make a difference in the final product.

    Reading a little more here, it almost seems as if you're using the wrong tool. It says that Illustrator is used for print and has no concept of a pixel, whereas Photoshop does. This might be part of the confusion.

    In the end, I think Save for Web and Devices is best, since that's what you're doing.

    Here's wikipedia's take on pixel density. Again, pixel density is not something that is intrinsic to an image itself, but rather to the device which will render the image for a human.