Saving file as 'Cairo PNG' creates incorrect file.

Bug #669267 reported by Jamie N on 2010-10-31
24
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Inkscape
Medium
Unassigned

Bug Description

I am using Windows XP 5.1.2600 and Inkscape .48. I created a document with a bitmap file imported and converted to a pattern to use as a fill (with the bucket fill) pattern. I added some lines and other tool created objects. When I saved it in a PNG format, other programs that attempted to display the object showed strange lines and rectangles where the pattern fill should have been.

Saving in PDF or exporting a bitmap seemed to work OK, as did a PSD file that I didn't know I created.

I'll attach the SVG file as well as the PNG if possible

Jamie N (jamie-pvco) wrote :
Jamie N (jamie-pvco) wrote :

Here is the PNG file that was created by the Save As selection.

Alvin Penner (apenner) wrote :

confirmed using File->Save As Cairo PNG.

the export bitmap option at 300 dpi does a better job, file attached

Changed in inkscape:
status: New → Confirmed
su_v (suv-lp) on 2010-11-01
tags: added: bitmap exporting
su_v (suv-lp) wrote :

The output file format "Cairo PNG (*.png)" was used for testing Cairo output:

>> Can someone tell me why we have a non-vector format in the save as list?
>> One that seems redundant and apparently with less functionality than the
>> normal export. Is this for testing purposes?
>
> Yes, it was for testing the Cairo output. It was part of the GSoC
> project to do PDF output, and was easy enough to add, so we left it in
> for testing Cairo rendering. Now, is anyone using it for anything now?
> Bulia? I'd imagine at this point it's cruft.
<http://thread.gmane.org/gmane.comp.graphics.inkscape.user/13065/focus=13070>

To export high-quality bitmaps (PNG) from Inkscape, do not save (a copy) as "Cairo PNG (*.png)", but always use 'File > Export Bitmap…' :
<http://tavmjong.free.fr/INKSCAPE/MANUAL/html/File-Export.html#File-Export-PNG>

su_v (suv-lp) wrote :

from 'src/extension/internal/cairo-png-out.cpp':
/*
 * A quick hack to use the Cairo renderer to write out a file. This
 * then makes 'save as...' PNG.
 *

Related issue:
The internal output extension 'org.inkscape.output.png.cairo' seems to get used (instead of 'sp_export_png_file()'?) when pasting the clipboard contents from Inkscape into e.g. a raster image editor like GIMP: the pasted images always have a white solid background and show the same rendering errors (e.g. with patterns) or missing filter effects as when saving an SVG drawing as "Cairo PNG".

Bug #404826 “copy an object from inkscape to system clipboard doesn't keep transparency”
<https://bugs.launchpad.net/inkscape/+bug/404826>

Jamie N (jamie-pvco) wrote :

Thank you for confirming the error. At this point I don't know enough about the program to know if it is something I didn't know that caused the problem. I did notice that exporting as a bitmap created a file with a .png extension instead of the usual .bmp that I usually see in graphics programs. I don't know the difference, and just learned that png was a raster image, not a vector.

What would be a really nice Tool, or perhaps an option on the PIck Colors / eyedropper tool, is to allow it to 'pick up' a pattern instead of just averaging the color from one. This would save a lot of steps in bringing in bitmap patterns from other files to use as fill. I had to use Photoshop to crop a .jpg pattern because I couldn't figure out how to crop in Inkscape.

I know Inkscape is a vector program, but it seems to have all the code to merge the vector and raster data already, it would sure speed things up with what I do, that being reproducing antique artwork on machinery tags and decals.

In discussing the available Save As options, it would be nice to have .jpg as an option, either in the Save As list, or in the Export selection, since there are a lot of sites that prefer .jpg for website display, especially the forums. That is actually why I found the .png bug in the first place, since I was looking for a format that the forum I frequent accepts, and .png was one of them.

I do like the program, I have been looking for an easy to use vector program ever since Wordperfect Drawperfect was (I guess) rolled into Corel Draw, which is way too difficult to learn for some reason. Kudos to everyone who develops and maintains Inkscape, you are creating a great program.

Jamie

su_v (suv-lp) wrote :

> Thank you for confirming the error

It is not exactly an error since the file format you used is not intended to create high-quality bitmap (aka raster) images from Inkscape drawings. As mentioned by both Alvin and me, use 'File > Export bitmap'. The real bug is that the option is available among the other vector file formats in the Save dialog(s) in stable release versions, as discussed in the linked thread on the devel mailing list.

See also: Inkscape manual - Exporting PNG (Portable Network Graphic) Files
<http://tavmjong.free.fr/INKSCAPE/MANUAL/html/File-Export.html#File-Export-PNG>

> What would be a really nice Tool, or (…)

Please don't mix different issues or feature requests in the same bug report, this makes it unnecessarily difficult to triage and track the originally reported issue. Adding a few comments below anyway... ;)

> to 'pick up' a pattern instead of just averaging the color from one

You can copy the object with the pattern fill and use 'Edit > Paste style' (Shift+Ctrl+V) on any other object you want to use the same pattern fill. This works across different Inkscape document windows, as does normal copy&paste.

Feature request:
Bug #171224 “versatile Dropper tool”
<https://bugs.launchpad.net/inkscape/+bug/171224>

> I couldn't figure out how to crop in Inkscape.

Inkscape doesn't crop linked or embedded raster images, but you can clip (or mask) an image with a path (or shape) or convert it into a pattern and use it as pattern fill for an arbitrarily shaped path. Both Inkscape methods are non-destructive.

Feature request:
Bug #517082 “Request Crop images”
<https://bugs.launchpad.net/inkscape/+bug/517082>

> would be nice to have .jpg as an option

Known feature request, tracked in
Bug #171390 “Extended Raster export support please”
<https://bugs.launchpad.net/inkscape/+bug/171390>

Jamie N (jamie-pvco) wrote :

Thanks for the response, sorry about clogging the post with other requests. I should have researched my requests before posting.

I gather the .png format with either go away or be put as an option in the export bitmap selection (with the appropriate filename extension).

Jamie

su_v (suv-lp) wrote :

> I gather the .png format with either go away or be put as an option in
> the export bitmap selection (with the appropriate filename extension).

'File > Export bitmap…' _does_ create a PNG file by default (it is the only raster format Inkscape exports to at the moment), with the correct file extension (*.png) appended in the export dialog. Please read the manual page about exporting:

Inkscape manual - Exporting PNG (Portable Network Graphic) Files
<http://tavmjong.free.fr/INKSCAPE/MANUAL/html/File-Export.html#File-Export-PNG>

Note that 'bitmap' image is used equivalent to 'raster' image:
<http://tavmjong.free.fr/INKSCAPE/MANUAL/html/Glossary.html#bitmapgraphics>
<http://en.wikipedia.org/wiki/Bitmap#Other_bitmap_file_formats>

su_v (suv-lp) wrote :

> I gather the .png format with either go away or be put as an option in
> the export bitmap selection (with the appropriate filename extension).

See also plans to reorganize export and save:

Bug #171054 “PDF better under "Export" than "Save As"”
<https://bugs.launchpad.net/inkscape/+bug/171054>
<https://blueprints.launchpad.net/inkscape/+spec/save-as-vs-export>
<http://wiki.inkscape.org/wiki/index.php/Save_as_vs_export>

One of the accepted GSoC 2010 projects this summer proposed to refactor the Inkscape Export Pane (unfortunately it wasn't finished): <http://thread.gmane.org/gmane.comp.graphics.inkscape.devel/33900>

su_v (suv-lp) wrote :

Raising importance to 'Medium': the export format "Cairo PNG" either needs to be renamed or disabled in release versions.

Changed in inkscape:
importance: Undecided → Medium
su_v (suv-lp) on 2012-02-07
summary: - Saving file in PNG format creates incorrect file.
+ Saving file as 'Cairo PNG' creates incorrect file.
su_v (suv-lp) on 2014-02-21
tags: added: png saving
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers