Extracting icons from a single image
I have purchased a set of icons.
In the package there are five files that contain all the icons, assembled on a regular grid in different file formats.
The file formats are
I need the icons to use in an android application I'm writing. I need around twenty of them at different resolutions (
The only way I know to extract the single icons is to do it by hand, but it would be a tedious and error-prone way.
Is there an automatic method, or a better way of getting the icons out of the files, at the various resolution I need?
What software will I need?
Ps. The icons i need to obtain have the following format:
As you can see, the icon is centered in a 64x64 bitmap. I have colored red the transparent part of the image to make it more visible.
Export objects from Inkscape as bitmaps
To export a vector object imported in Inkscape as a bitmap of defined pixel size we need the following steps:
Case source icons include background
Select the object with the select tool.
Export the object as bitmap ("File - Export Bitmap...").
Choose ""Export area - Selection" to only export the object.
- Define the pixel size (above 64 x 64) for the resulting bitmap.
- Choose a path and a filename for export.
Note: There is a batch option in Inkscape for exporting multiple selected objects in the "Custom" option but this will not let you define a fixed pixel size for each object.
Case source icon objects only
In case the source icons do not include a square box with margins the above steps will lead to a distorted icon when the object has a with different to height. We then need an additonal step to get desired results.
- Select object with the select tool.
- Copy the object to clipboard.
- Open a new document having the size of the source icons. In Inkscape you will have predefined layouts in the File - New menu (here I took
- Paste the clipboard content to the new document.
- Align the icon, e.g. to the center using the "Object - Align and Distribute..." tool.
- Export the page as bitmap with "File - Export Bitmap...".
- Choose "Page" and the desired bitmap sizes in the opening dialog (see above). We can export all sizes consecutively.