Android – way to create xxhdpi, xhdpi, hdpi, mdpi and ldpi drawables from a large scale image

android

Is there a way to create xxhdpi, xhdpi, hdpi, mdpi and ldpi drawables from a large scale image automatically? For example assume that I have a 512×512 image and I want to have different versions of this images for different screen resolutions supported by Android in appropriate folders.

Best Answer

Option #1: Just ship the -xxhdpi drawables and let Android downsample them for you at runtime (downside: will only work on fairly recent devices, where -xxhdpi is known).

Option #2: Use Android Asset Studio to downsample them for you.

Option #3: Automate the process within a graphics editor, per ssantos' answer.

Option #4: Script yourself a solution, using something like ImageMagick.

Option #5: Use image baker

Related Topic