AndroidImageSizer.exe is a utility to resize png images to the proper dip sizes.
New version 1.04
Unnecessary link to not existing external reference removed, the error on image load should now gone.
New version 1.03
This (preliminary) final version now works with 9patch images.
The boundary of the 9patch will maintain it's 1 pixel width on scaling.
The calculated size is the base image size without boundary.
The parameter /8 can be used with this image format, 9patch works with 8 bit png too.
New version 1.01
This version can create 8 bit png files. Most programs save 8 bit png with only one transparency value for pixel: on or off.
But this files maintains the (almost) full alpha channel for transparency.
(Thanks to pngquant library - https://pngquant.org/).
Using 8 bit png shrinks image file size at 50-75% with mostly no or minimal visible drawbacks.
It's a command line program best used with a batch file (example batch is included).
The following parameter can be given:
Make sure the source images are large enough for high quality rescaling (i'm using normally a minimum of 256 pixel).
You can download the program here: AndroidImageSizer
New version 1.04
Unnecessary link to not existing external reference removed, the error on image load should now gone.
New version 1.03
This (preliminary) final version now works with 9patch images.
The boundary of the 9patch will maintain it's 1 pixel width on scaling.
The calculated size is the base image size without boundary.
The parameter /8 can be used with this image format, 9patch works with 8 bit png too.
New version 1.01
This version can create 8 bit png files. Most programs save 8 bit png with only one transparency value for pixel: on or off.
But this files maintains the (almost) full alpha channel for transparency.
(Thanks to pngquant library - https://pngquant.org/).
Using 8 bit png shrinks image file size at 50-75% with mostly no or minimal visible drawbacks.
It's a command line program best used with a batch file (example batch is included).
The following parameter can be given:
- /out:dirname The path to the res directory of your project (the final drawable-.... dir will be added)
- /ldpi /mdpi /hdpi /xhdpi /xxhdpi /xxxhdpi Use this parameters to set the needed images. To set all modes at once use /all.
- /copy Doesn't resize images, only copy to target directory (normally used in combination with /8 parameter).
- /dip:size Use this parameter to set the final image size. Because mdpi has a density of 1.0, this value is the final image size in pixel for mdpi. Example: if you set /dip:40 the final mdpi image has a size of 40 pixel, the hdpi image 60 pixel and so on.
- /8 Reduce png to 8 bit palette (256 colors) but maintain alpha channel.
- On rectangular images the given dip size is used for the small image size. If the large size should be used use the /l parameter.
- If you set the /m parameter the images will not processed if the target file exists and the source file has not been changed.
- Set the /r parameter to scan subdirs also for image files.
- The last parameter(s) is one or more source files or dirs. If you place a filename wildcards can be used. The file extension is not needed because only png files will be used. If you use a directory name all files in this directory will processed.
Make sure the source images are large enough for high quality rescaling (i'm using normally a minimum of 256 pixel).
You can download the program here: AndroidImageSizer
Last edited: