What is Android Image Resizer?
Android Image Resizer is a tool to automate android project image files resizing for all screen density supported by your app.
For example a image in res/drawable/xhdpi with 200x200px as a base file will be resized to :
- res/drawable/hdpi with 150×150 px
- res/drawable/mdpi with 100×100 px
- res/drawable/ldpi with 75×75 px
Source Code on
Install Instructions
Note: For Mac OSX you need to install rimagick first. Please follow the instructions described in this page rimagick
How To use it
In a Android Project directory (PATH that has a AndroidManifest.xml) please type:
To list all drawable resource imagefiles
To Resize a resource image File
To Resize all resource image files
Note: by default Android Image resizer will use xhdpi as base image file.
To use hdpi as base image file please type hdpi in the optional argument
Resize a image example:
android_img_resizer img ic_home_log.png
OUTPUT:
Resizing Image = ic_home_log.png with size = 64×64
Image = ic_home_log.png hdpi = 48×48
Image = ic_home_log.png mdpi = 32×32
Image = ic_home_log.png ldpi = 24×24
Resize all images example:
android_img_resizer all xhdpi
OUTPUT:
Resizing Image = ic_micro_site.png with size = 64×64
Image = ic_micro_site.png hdpi = 48×48
Image = ic_micro_site.png mdpi = 32×32
Image = ic_micro_site.png ldpi = 24×24
Resizing Image = ic_micro_logo.png with size = 64×64
Image = ic_micro_logo.png hdpi = 48×48
Image = ic_micro_logo.png mdpi = 32×32
Image = ic_micro_logo.png ldpi = 24×24
…..
License and copyright
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the “Software”), to
deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
Contributions are welcome ! The project is mainly missing documentation and examples…
Just curious if this program was meant to be run in ubuntu or another form of linux, because when I type in the suggested info I get “command not found” after trying to list the files or do anything else with the tool. Installed ImageMagick and Lib files so I’m sure why it would be throwing this error
Yes it can run on ubuntu machine. After the android_img_resizer gem install the command android_img_resizer should be on your PATH. Check your rubygems enviromment or your user PATH.