Clipped bitmap --> closed path filled with patterh
I have been producing a series of diagrams illustrating the effect of the various rendering intents. I found an SVG of the CIE 1930 chromaticity diagram and dismantled it to provide a background for my purposes.
The familiar (closed) horseshoe shape is clipped from a rectangular bitmap of the radial colours of the visual spectrum: going around the outside border anti-clockwise, the rays from the white point (centre) to the border are R, Y, G, C, B, M and back to R (i.e. RGB and CMY interleaved).
Trouble is this doesn't translate to PDF via the Cairo processor, or to PS and PDF via Ghostscript. The clipping of the bitmap is lost and the the border path just appears as an object on top of the full rectangular bitmap. The text labels are aliased in a very ugly way when I try to output to PNG.
So I thought to convert the bitmap to a pattern, then fill the horseshoe path with the pattern. No joy. The bitmap turns into a slightly smaller rectangular pattern that is divided into four unequal quadrants, that is, it is tiled.
It looks nothing like the demonstration on page 190 (204 of 341) of //Inkscape: Guide to a Vector Drawing Program//. This shows a picture of a 1920s couple getting into an early MG sports car, then the same picture used as a fill in a circular object, then the pattern translated to change the details included in the fill.
If that pic was mine, after changing to a pattern, the pattern would be smaller than the pixmap, and part of the RH and Bottom sides of the pixmap would appear as thin bands extending the LH and Top sides of the pixmap, i.e. the couple and sports car cut up in a way where it would be impossible to show the full graphic as a pattern fill in any object.
What I really wanted was the bitmap to turn into a single tile pattern, i.e. a repetition of 1 both vertically and horizontally. Then I could fill the horseshoe border with the radial colours. It didn't look anything like the pattern on page 189 top.
So what should I have done?
Regards, Hedley
Windows XP SP2; Inkscape 0.46; //Inkscape: Guide to a Vector Drawing Program//, Tavmjong Bah, ed. 0.13 (documenting Inkscape 0.45.1)
--
Hedley Finger
28 Regent Street Camberwell VIC 3124 Australia Tel. +61 3 9809 1229 Fax. (call phone first) Mob. (cell) +61 412 461 558 Email. "Hedley Finger" <hfinger@...2483...>
On Thu, 2008-06-12 at 15:55 +1000, Hedley Finger wrote:
You have touched on a very important but very confusing subject.
Trouble is this doesn't translate to PDF via the Cairo processor, or to PS and PDF via Ghostscript. The clipping of the bitmap is lost and the the border path just appears as an object on top of the full rectangular bitmap. The text labels are aliased in a very ugly way when I try to output to PNG.
Clipping is not supported in PS and PDF output via the "Save As" dialog. For some reason, it appears that Inkscape has two different PDF Cairo routines (pdf-cairo.cpp and cairo-render-context.cpp) -> WHY??? <-. The code (v0.46) used by the "Print" dialog (cairo-render-context.cpp) does support clipping (but crashes with masks). While the code used by the "Save As" dialog (pdf-cairo.cpp) doesn't support clipping or masks.
Have you tried increasing the resolution for the PNG output?
So I thought to convert the bitmap to a pattern, then fill the horseshoe path with the pattern. No joy. The bitmap turns into a slightly smaller rectangular pattern that is divided into four unequal quadrants, that is, it is tiled.
Patterns are incorrectly exported in the Cairo based PS and PDF output.
https://bugs.launchpad.net/inkscape/+bug/217212
It appears that the "Print" dialog method does export a pattern correctly if it has not been transformed.
It looks nothing like the demonstration on page 190 (204 of 341) of /Inkscape: Guide to a Vector Drawing Program/. This shows a picture of a 1920s couple getting into an early MG sports car, then the same picture used as a fill in a circular object, then the pattern translated to change the details included in the fill.
Just tested, this works fine in Inkscape 0.46 and as a PNG export. The image (left object) and untransformed (middle object) are "printed" correctly to PDF. The transformed (right object) is not.
Tav
Tavmjong Bah wrote:
So I thought to convert the bitmap to a pattern, then fill the horseshoe path with the pattern. No joy. The bitmap turns into a slightly smaller rectangular pattern that is divided into four unequal quadrants, that is, it is tiled.
I have had another look at the so-called "pattern" produced from the pixmap. In /Inkscape: Guide to a Vector Drawing Program/, the example shows a small tile consisting of a few objects that is converted into a pattern. But when I selected a pixmap and turned it into a pattern, the pixmap was cropped so that only part of the area was converted to a pattern. It is not possible to apply transforms to fill a closed path with a single tile that shows the same area as the original.
Is it significant that the pixmap is imported by reference from an external file? I notice that if I modify these external files in Gimp, then the next time the importing SVG is opened the pixmap is updated. Do pixmaps actually have to be embedded in the SVG file for patterns to be created correctly? I will try enclosing the pixmap in an invisible border, grouping it with the border, then creating a pattern from the grouped compound object.
Regards, Hedley
--
Hedley Finger
28 Regent Street Camberwell VIC 3124 Australia Tel. +61 3 9809 1229 Fax. (call phone first) Mob. (cell) +61 412 461 558 Email. "Hedley Finger" <hfinger@...2483...>
participants (2)
-
Hedley Finger
-
Tavmjong Bah