Inkscape.org
Beginners' Questions Background color for exported Vector graphics
  1. #1
    Engineeringtech Engineeringtech @Engineeringtech

    I downloaded and installed Inkscape many years ago for a very limited use.  I wanted to import vector drawings (DXF or PDF format), and export them as high resolution raster images (JPG's or PNG's). I have to admit I have only used the application a couple times.   Yesteday I imported a PDF drawing, and exported to PNG.  It appeared to be ok.  I tried again, with another drawing, and this time the background for the lines was black instead of white!  I don't want a raster image on a black background because some of the lines are black.  I can't figure out what I did to cause this, and how to correct it.  Does anyone have any idea?

  2. #2
    Freezr Freezr @freezr
    *

    Hi @Engineeringtech

    I don't know if there aleardy explicit rules, but for me to have the best support availabe you need to fill up this template:

    Inkscape version:
    Operative System:
    What you tried to achieve:
    What kind of files you used:
    How did you save/export your artwork:
    Share the file if you can:

     

    Engineeringtech

    I tried again, with another drawing, and this time the background for the lines was black instead of white! 

     

    It is really impossible understand what happened.. Maybe your file was rastered and since the moment there wasn't a proper alpha channel you got a black background, this file had a black background, nobody can tell.

  3. #3
    Aero Aero @Aero◻️

    @Engineeringtech

    Are you sure your raster image has a black background? Maybe it is just transparent? In Document Properties, turn on Checkerboard background to be able to see if it is transparent or not before exporting. If needed add a new background (rectangle lowered to bottom). 

  4. #4
    brynn brynn @brynn

    Welcome to the forum!

    Where are you viewing the image?  If you see the black background in a file manager, don't worry about it.  A lot of software or websites can't handle transparency properly, and display it as black.  I've even seen some image hosts (ImageShack, specifically) which are not able to handle transparency, and display a transparent background as black.  File managers often cannot handle transparency either, and display as black.

    If you open in the image in a dedicated image viewer, it should be ok.

    You actually don't need to turn on the checkerboard to prove that the Inkscape background is transparent.  You can just look at the background setting, which is just below the checkerboard option in Document Properties.  If the A slider (the alpha channel) is all the way to the left, with a value of 0, then it's transparent.

  5. #5
    Engineeringtech Engineeringtech @Engineeringtech

    I'd post attachments if I had a way to do that...   The PDF file I'm importing into Inkscape is a VECTOR drawing.  Viewed in Acrobat Reader, it has red and black lines on a white background.  It still shows red and black on a white field in Inkscape.    I need to convert this vector drawing to a raster image.    The first couple times I exported a PNG bitmap they showed the lines on a white background.  (I use Irfanview to look at the bitmaps.)    Then the export changed.  It started placing the lines on a black background, which hides all the black lines in my drawing.disappear.   If I dump the bitmap into my word document, it also shows as red lines on a black background.  So this is not a file manager issue.    Apparently something happened to the export process, and I don't know what. 

    Incidentally, the version I am running is 0.48.  I will need to ask the IT manager to install a newer version.  Not sure he will do that for me...

  6. #6
    Freezr Freezr @freezr
    *

    @Engineeringtech did you delete your post?

    Once I worked in company where was impossible get any kind of software, even the one like Inkscape, hence I found a project called portable apps, which are simply stand alone bundle that run without need to install them.

    https://portableapps.com/apps/graphics_pictures/inkscape_portable

    You can download it, check with it out your antivirus and, if everything is ok, just uncompressed in whatever folder and run it!

  7. #7
    Freezr Freezr @freezr

    @Engineeringtech If I understood well you need just to convert these PDFs into a bitmap image, isn't it? Or do you need to perform some changes too? If it is just the convertion, you can use and get Gimp from the same source where I posted a link to the portable inkscape.

  8. #8
    brynn brynn @brynn
    *

    I don't know much about Irfanview.  But what I know of it, it should be able to handle transparency properly.

    Does your computer have an image viewer you could test with?

    When you said

    Engineeringtech

    I'd post attachments if I had a way to do that...

    do you mean it's something about your computer which prevents it?  Or you just don't know how to do it in this forum?  If it's not knowing how, here's how  🙂

    • In the bottom-left corner of this message box (just left of "Please read the Code....."), click on the paperclip icon.
    • Now in the bottom-right corner, click UPLOAD FILE.
    • Choose the file from wherever it is, then there should be a button called Open or something like that.
    • If you're finished typing your message, click Submit Reply.

    Edit

    You aren't using Save As Cairo png, are you?  I don't think that would give a black background.  But in any case, the proper way to export a PNG file is File menu > Export PNG

  9. #9
    Engineeringtech Engineeringtech @Engineeringtech

    Thank you everyone for the help.  I really appreciate it.  However, I have discovered the problem.  When I used Document Properties to change the paper orientation from Portrait to Landscape, Inkscape defaulted to a black background for the export.   The change was not apparent UNTIL I looked at the bitmap export.  I had never monkeyed with the background color settings and couldn't see it on the Inkscape screen, so I thought something wierd was going on with the settings for the resolution.    I opened the Document Properties window, and reset the background to  color 255, and the problem was solved. 

  10. #10
    Freezr Freezr @freezr

    Cool!

  11. #11
    brynn brynn @brynn

    Hopefully your admin can upgrade Inkscape for you!

  12. #12
    Engineeringtech Engineeringtech @Engineeringtech

    Gnuserland- 

    As it happens, I have Gimp 2.8 installed.  (It's been so long since I used it, I forgot it was there.)...Never learned how to use it.   I may have to..

    Thanks for the suggestion.

  13. #13
    Freezr Freezr @freezr

    @Engineeringtech open a pdf and export as whatever is a pretty easy task, my only advice is to pay attention between "save as" and "export as", the former save only in native Gimp format (XCF) while the latter in all the others formats available (almost everyone 😁 ).

  14. #14
    Engineeringtech Engineeringtech @Engineeringtech

    Do I have to SELECT something first?  How? My attempts thus far have produced no bitmaps.

  15. #15
    Freezr Freezr @freezr

    @Engineeringtech

    For every Gimp related question, I think, you should ask somewhere else, however about handling PDF with GIMP there are plenty of articles out there...

  16. #16
    Engineeringtech Engineeringtech @Engineeringtech

    Ok, You're right.  Got off track when you suggested Gimp.  Bye!

  17. #17
    brynn brynn @brynn

    Gimp has a free online manual, the last time I looked.

Inkscape Inkscape.org Inkscape Forum Beginners' Questions Background color for exported Vector graphics