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