Inkscape.org
Beginners' Questions Copying an image from a file to a new file gives a black image
  1. #1
    Red2347816 Red2347816 @Red2347816

    I first open this file: https://media.inkscape.org/media/resources/file/Flag_of_Canada_19211957.svg. I select the entire image by pressing Ctrl + A. I copy the image by pressing Ctrl + C. I then make a new file by pressing Ctrl + N. I then paste the image in to the new file by pressing Ctrl + V. The image I get is however black. How do I fix this?

  2. #2
    Polygon Polygon @Polygon🌶
    *

    Seems the same here with macOS; cmd+C don´t do anything - but right-click copy+cmd+V will - and copy&paste from the edit menu will do either.

    If you compare the header of the XML-tree of the file you linked and the new one as Inkscape SVG you´ll notice some differences that might cause this issue. Or this is intentional to avoid copy&pasting by default.

    Flag Of Canada 19211957Inkscapesvg
  3. #3
    Tyler Durden Tyler Durden @TylerDurden
    *

    Looks like a typical use of CSS for the styles. I don't think it is trying to be obstructive.

    I am searching for an extension that replaces the css with inline styles, but I'm not getting far.

    The dropper can be used to replace manually (click with dropper 2x) and select-same beforehand works for all. Downside seems that the z order gets wonky on copy/paste. Grouping before copy/paste seems to resolve the z-order issue.

    Flag Of Canada Td Pasted
  4. #4
    Red2347816 Red2347816 @Red2347816

    Do you know where the dropper is in Inkscape? Do you know where select-same beforehand works for all is? Thank you.

  5. #5
    Polygon Polygon @Polygon🌶
    👍

    As I wrote "save as" Inkscape SVG solves the issues with this file - maybe first close and reopen. "D" for Eyedropper? Shift+D for stroke color then.

  6. #6
    Red2347816 Red2347816 @Red2347816

    The image still comes black in the new file though when I paste it into it. I am not trying to paste the image into the same file. I am trying to paste the image into a new file.

  7. #7
    Polygon Polygon @Polygon🌶

    Not so here. Copy+paste via menu or right-click works flawlessly.

    In case you didn´t found the Inkscape file here it is again:

  8. #8
    Tyler Durden Tyler Durden @TylerDurden

    Must be something special about Polygon's setup. Saving as Inkscape SVG still produces black fills on .92.2 (on WIn) and 1.2 (on Linux).

  9. #9
    Polygon Polygon @Polygon🌶

    It's not just saving as Inkscape SVG ; it's closing Inkscape and restart, loading the new flag file. And maybe it's the way clipboard on macOS works. At least just cmd+C don't work on the original file.

  10. #10
    Red2347816 Red2347816 @Red2347816

    How come you (Tyler Durden) and I are getting black fills and Polygon is not getting black fills? Do I have to change the fill color every time I copy the image? Thank you.

  11. #11
    Tyler Durden Tyler Durden @TylerDurden

    Interesting....seems grouping before copy helps, even on the original.

  12. #12
    Polygon Polygon @Polygon🌶

    Of course not. I believe it's how this SVG is set up.(compare it in a text editor aside an Inkscape file) I don' t have an "normal" SVG at hand, because I'm on an iPad right now. Will upload or redirect to some later for you to test - or does this happen with all SVGs on your system? Then it's a more serious problem than I initially thought.

  13. #13
    Tyler Durden Tyler Durden @TylerDurden

    The original svg was probably generated in AI or such, using css instead of inline styles. Not too unusual.

  14. #14
    Polygon Polygon @Polygon🌶

    Question is how to go about with it in Inkscape when copy&paste don´t work on this? Have you tried maybe a Clean Up Document followed by save as Optimised SVG which will convert CSS to XML regarding the dialog. Copy&paste on this works here as well.

  15. #15
    Tyler Durden Tyler Durden @TylerDurden

    Copy/paste to new document works if grouped before copying.

    Clean up doc has found no unused defs.

    Optimized svg does not help in v .92. Can't check 1.1 here for a few days.

  16. #16
    Red2347816 Red2347816 @Red2347816

    I don't think grouping helps here as I am getting black fills regardless of any groups. Could it be that my Inkscape is malfunctioning? If yes, how do I fix my Inkscape? Would I have to get a new Inkscape? If yes, what new Inkscape should I get? Thank you.

  17. #17
    Tyler Durden Tyler Durden @TylerDurden

    Please describe your OS & version, Inkscape version and any system extras like tablets, multiple monitors, flux capacitors, etc.

  18. #18
    Red2347816 Red2347816 @Red2347816
    👍

    I am currently using Inkscape version 0.92.4 on Windows 10 version 2004. I currently have one monitor and no flux capacitors or tablets.

  19. #19
    Tyler Durden Tyler Durden @TylerDurden
    *

    Not sure what the issue could be. Attached is a recording of Inkscape .92.2 on Win 8.1.

  20. #20
    Red2347816 Red2347816 @Red2347816

    Here is a video that shows that pasting the image in a new file after grouping gives black fills:

    https://inkscape.org/gallery/item/27713/final_60d6a5f6a9f0d500daa40d34_245802.mp4

    How would I find out what the issue is? Could it be that my Inkscape is malfunctioning? If yes, how do I fix my Inkscape?

  21. #21
    Tyler Durden Tyler Durden @TylerDurden

    The file in the video has a different name, and could be a different file. Please share that exact file to ensure we are not confusing the issue.

     

  22. #22
    Red2347816 Red2347816 @Red2347816

    The file is the same as https://media.inkscape.org/media/resources/file/Flag_of_Canada_19211957.svg. The Inkscape website renamed the file because it removes any parentheses and hyphens in any file name uploaded to it. You can rename the file back to Flag_of_Canada_(1921–1957).svg after downloading the file so that you have the same file name as me. Thank you.

  23. #23
    Paddy_CAD Paddy_CAD @Paddy_CAD

    I can't reproduce your problem using Inkscape 1.1 and macOS 10.15 on my very old MacBook Air.  Copy and paste work as expected.  All the CSS styles in the original are converted to inline styles in the copy.  Duplicating retains the CSS styles of the original.  The copies render perfectly when pasted into the original file or any other file.  

  24. #24
    Red2347816 Red2347816 @Red2347816

    I do not get black fills if I paste a copy into the same file. I only get black fills if I paste the image into a different file. I am currently using Inkscape version 0.92.4 on Windows 10 version 2004. If the problem persists, I can send you the file so that you can copy it for me. Thank you.

  25. #25
    Polygon Polygon @Polygon🌶

    The attached fiel from reply#7 (optimized SVG) still don´t work for you? I will attache 3 more converted files. Testing the original with other SVG editors makes me wonder Inkscape handles it so well; Affinity Designer and Vectonator are displaying most of the parts in "black" on loading. Intaglio refuses to open it at all with error message: File: SVGConverter.mm Line: 614.

     

    Flag Of Canada Rev
  26. #26
    Red2347816 Red2347816 @Red2347816

    The optimized SVG from reply #7 gives black fills when I copy it into a new file. The files Flag_of_Canada_Pixelmator.svg and Flag_of_Canada_Rev.svg from reply #25 work fine. I will use these images from now on. Can you tell me more on how did you fix the problem so that I can fix the problem myself the next time I come across a similar problem? Thank you.

Inkscape Inkscape.org Inkscape Forum Beginners' Questions Copying an image from a file to a new file gives a black image