It seems that the latest Inkscape really restricts your export options. I have a number of SVG images that need to be exported to monochrome bitmaps of various sizes. The requirement for there to be various sizes is why I used Inkscape in the first place to create images. Unfortunately, even though the SVG images themselves only use full-on white and full-on black, when they are exported as PNG a lot of greys get added in what I guess is an anti-aliasing process, which is fancy but too complicated for my needs.
Do you all have any tips to get a 1bpp BMP? Should I make the SVG images a certain size and then do Print Screen?
Exporting as 1bpp BMP
Exporting as 1bpp BMP
- Attachments
-
- championwhite.svg
- (3.01 KiB) Downloaded 260 times
-
- championmask.svg
- (3.01 KiB) Downloaded 255 times
-
- championblack.svg
- (3 KiB) Downloaded 298 times
Re: Exporting as 1bpp BMP
Hi beneficii,
- install imagemagick, a tool for command-line image conversion, that also has a batch conversion mode (http://www.imagemagick.org)
- export your your drawing to pngs in different sizes as normal,
- then do this on your command line (if it doesn't work as expected, take a look at their website to fine-tune the options, especially to set the threshold, might involve an additional step):
- or, if it's more than one image, and they are all in the same directory, try the batch mode:
Edit: also take a look at these options:
in case you need them.
- install imagemagick, a tool for command-line image conversion, that also has a batch conversion mode (http://www.imagemagick.org)
- export your your drawing to pngs in different sizes as normal,
- then do this on your command line (if it doesn't work as expected, take a look at their website to fine-tune the options, especially to set the threshold, might involve an additional step):
Code: Select all
convert -colors 2 -depth 1 truecolor.png 1bpp.bmp
- or, if it's more than one image, and they are all in the same directory, try the batch mode:
Code: Select all
mogrify -format bmp -colors 2 -depth 1 *.png
Edit: also take a look at these options:
Code: Select all
-type bilevel -alpha off
in case you need them.
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!
Inkscape FAQ - Learning Resources - Website with tutorials (German and English)
Inkscape FAQ - Learning Resources - Website with tutorials (German and English)
Re: Exporting as 1bpp BMP
Thanks. Unfortunately, for the smallest bitmaps, it still looks messed up. The smallest is 21x21 pixels.
I tried turning anti-aliasing off in Inkscape 0.91 for the document, but turning it off does not seem to apply to exported files.
I'm going to try another option which is to import the SVG into GIMP and set the resolution. I am told turning off the anti-aliasing will work with that.
Nevertheless, if I cannot save 1bpp BMP files with GIMP, I will definitely use mogrify again.
I tried turning anti-aliasing off in Inkscape 0.91 for the document, but turning it off does not seem to apply to exported files.
I'm going to try another option which is to import the SVG into GIMP and set the resolution. I am told turning off the anti-aliasing will work with that.
Nevertheless, if I cannot save 1bpp BMP files with GIMP, I will definitely use mogrify again.
Re: Exporting as 1bpp BMP
(does it work if you do the resize in imagemagick instead? - just because it could be faster)
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!
Inkscape FAQ - Learning Resources - Website with tutorials (German and English)
Inkscape FAQ - Learning Resources - Website with tutorials (German and English)
Re: Exporting as 1bpp BMP
The BMP's produced by imagemagick could not be loaded using the Windows API function LoadBitmap(). What I do instead is load the SVG in Gimp with the correct dimensions and then copy and paste the image to MSPaint. It's lengthy work, but it pays off.
Re: Exporting as 1bpp BMP
I'm glad you found a way to make it work - even if it's not exactly comfortable...
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!
Inkscape FAQ - Learning Resources - Website with tutorials (German and English)
Inkscape FAQ - Learning Resources - Website with tutorials (German and English)