- satocis / create_android_mipmap_icon_from_svg.sh
- Конвертер SVG в PNG
- Сконвертируйте ваши svg-файлы в png онлайн и бесплатно
- Масштабируемая векторная графика
- Портативная сетевая графика
- Как сконвертировать SVG в PNG
- Загрузите svg-файл(ы)
- Выберите «в png»
- Загрузите ваш png-файл
- Convert SVG vector to Android multi-density png drawables
- 4 Answers 4
- How to create Android PNG Icons from an SVG using GIMP
- 1 Answer 1
- How to generate png from vector drawable launcher icon with minSdkVersion 21?
- 2 Answers 2
satocis / create_android_mipmap_icon_from_svg.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
#! /bin/sh |
# `svg’ to `png’ with inkscape |
# |
# Usage: |
# Use vector drawables for icon instead of using this script. |
inkscape —version > /dev/null 2>&1 |
if [ $? -ne 0 ] ; then |
echo inkscape not found >&2 |
exit 1 |
fi |
png_size_list= ‘ 48 72 96 144 192 ‘ |
icon_extension=.png |
svg_extension=.svg |
for svg_file in * $ |
for size in $png_size_list ; do |
inkscape —export-png= $ |
-w $ |
$ |
done |
done |
exit 0 |
# Local Variables: |
# mode: sh |
# coding: utf-8-unix |
# End: |
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Источник
Конвертер SVG в PNG
Сконвертируйте ваши svg-файлы в png онлайн и бесплатно
- Image
- Document
- Ebook
- Audio
- Archive
- Video
- Presentation
- Font
- Vector
- CAD
- abc
- abw
- csv
- dbk
- djvu
- dng
- doc
- docm
- docx
- erf
- ebm
- ewm
- emw
- gzip
- kwd
- odt
- oxps
- ppt
- pptx
- rtf
- rar
- txt
- wps
- xls
- xlsx
- zip
- Image
- Document
- Ebook
- Audio
- Archive
- Video
- Presentation
- Font
- Vector
- CAD
- abc
- abw
- csv
- dbk
- djvu
- dng
- doc
- docm
- docx
- erf
- ebm
- ewm
- emw
- gzip
- kwd
- odt
- oxps
- ppt
- pptx
- rtf
- rar
- txt
- wps
- xls
- xlsx
- zip
Масштабируемая векторная графика
Портативная сетевая графика
Как сконвертировать SVG в PNG
Загрузите svg-файл(ы)
Выберите файлы с компьютера, Google Диска, Dropbox, по ссылке или перетащив их на страницу.
Выберите «в png»
Выберите png или любой другой формат, который вам нужен (более 200 поддерживаемых форматов)
Загрузите ваш png-файл
Позвольте файлу сконвертироваться и вы сразу сможете скачать ваш png-файл
Источник
Convert SVG vector to Android multi-density png drawables
I have some icons in SVG format, and want to convert them to Android png drawables, in the following sizes: drawable-mdpi , drawable-hdpi , drawable-xhdpi , drawable-xxhdpi and drawable-xxxhdpi .
What’s the easiest way to convert an SVG to drawable pngs?
4 Answers 4
Question might be a bit outdated, but I searched Internet and didn’t find any good solution. So I wrote a simple bash script which does conversion of SVG as well as raster image formats.
It requires at least ImageMagic, which on OS X can be installed via brew or macports . Unfortunately ImageMagic poorly converts SVG, so I added support of Inkscape. If Inkscape is not installed, script falls back to ImageMagic conversion.
There is an online tool I worked on which can convert an svg image to different platforms, including android.
By default it will convert it to Android drawable, so you need to change the Android setting from auto to png and it will create all the densities you need.
Please note that the mdpi resolution will have the same size as the svg. So you may need to change the width/height parameters to enlarge to output. Or your can try the service for free which will let you specify the output resolution of the mdpi version.
This is too late but I found this Github Java project, named SVG to PNG Converter, really quick and easy to convert SVG files to Android compatible png drawables.
I’ve seen this recently, I saw answers but they are difficult.
This online tool too much easier https://appicon.co/
You can convert any image to android multi density or IOS
Источник
How to create Android PNG Icons from an SVG using GIMP
I’m pretty much a graphics design noob, as you can tell by this very basic question. What I am trying to achieve is to create a set of Android icons from an SVG file that I have. In case you didn’t know, in order to support the different device sizes, I am supposed to create an icon for MDPI, HDPI, and XHDPI screens. More detailed information can be found here
Here is the recommended dimensions for each size:
- MDPI — 160dpi, 48x48px
- HDPI — 240dpi, 72x72px (1.5x MDPI)
- XHDPI — 320dpi, 96x96px (2x MDPI)
As I said before, I am starting with an SVG file that I have. The first thing I am doing is opening the SVG file using GIMP. Here is where I start to get confused. What value should I put for the pixels/in? The default is 90.
After I get past that screen, I pretty much just export it right away to a PNG. When I do that, I am prompted with another screen with a bunch of different options. Usually I just leave it as the default, but I’m not sure if that’s the best idea. Anyways, when I go through this process, my icons still look really blurry on my Nexus 4.
Any help is greatly appreciated.
1 Answer 1
The Android Developers link is a bit confusing because it mentions DPI, but you shouldn’t be worrying about that. DPI is important for the devices, but it’s not necessary for designing the icons (I don’t normally use Gimp so I don’t know if it has an automatic way of preparing files for different resolutions, but I’ll assume you want to do it manually and will create copies for each size).
The important part is the following:
To create an icon for different densities, you should follow the 2:3:4:6 scaling ratio between the four primary densities (medium, high, x-high, and xx-high, respectively). For example, consider that the size for a launcher icon is specified to be 48×48 dp. This means the baseline (MDPI) asset is 48×48 px, and the high density (HDPI) asset should be 1.5x the baseline at 72×72 px, and the x-high density (XHDPI) asset should be 2x the baseline at 96×96 px, and so on.
Now to your problem:
You have an SVG file with a set of icons. The documentation says the recommended size for the biggest density is 96x96px. This is because smartphones have double the pixel density of desktop monitors.
That’s why a 48x48px icon will look ok in your computer but blurry in your nexus, because your nexus needs more quality to fill the same space. It needs exactly 2x quality, because it’s a 2x MDPI screen (it has double the amount of pixels per «pixel space», while 1.5 MDPI has 1.5x density).
In short: You will need 3 icons. The sizes are 48x48px, 72x72px and 96x96px. In the devices, your icons will all look the same size, because they are being scaled to keep a good quality when the screen has more resolution.
The pixels/in issue you mention is for printing, and not for digital, so you don’t need to worry about that. Just make the icons those sizes, and you will see it looks good in the Nexus.
These are some other questions that discuss working with app icons:
Источник
How to generate png from vector drawable launcher icon with minSdkVersion 21?
I have an app with minSdkVersion=21 which now uses an vector drawable as a launcher icon.
Google Play rejects the app with
since it needs to launcher icons in PNG format.
I would like to generate PNG files for the launcher icon as part of the build process, just as is done if I lower minSdkVersion to 20 (but I cannot do that, since the app is not compatible with 20 or older). Is this possible?
EDIT: To clarify, it works when the minSdkVersion is = 21, gradle leaves vector drawables as is, which does not work for launcher icons. The question is if it’s possible to make gradle build png versions of vector drawables for launcher images even on minSdkVersion >= 21.
2 Answers 2
It seems Google Play supports vector drawables now (Dec 2017) as launcher icons. I have recently uploaded and published an app with a vector laucher icon.
I don’t think that’s possible to convert android’s vector drawable format(also really similar to SVG) to PNG in building process.
And in your case, you need to convert the vector drawable to SVG by hand, I think that’s not hard, then convert that general SVG to PNG(convert cmd in ImageMagick toolkit should be cool).
If you need some cool tool to generate all size sets of launcher icon, use the online web app Android Asset Studio
anyway, I don’t think that’s a good idea to convert your android vector XML to PNG in building process, also it is possible to do that, you need to write another custom android Gradle plugin which can read the vector drawable XML file and convert it to SVG first maybe, then to your final PNG format. That’s a lot of java or Groovy code, and just too complicated for a simple project.
Источник