Postby ScapeGoat » Sat Mar 23, 2013 9:42 am
Hello, druban,
This is actually a different problem. If the two threads get combined, I fear that the two issues will become confused. The previous question was asking about a way to save an embedded rasterized image to PNG in its native horizontal & vertical pixel count. Your solution was to use Exensions->Image->Extract rather than the File->Export function. That worked well, and I noted some caveats for those new to the use of that extension.
This is a different file, different image, and the question isn't about what feature to use to export a PNG with the native pixel count. The problem is that the exported PNG is black.
Some of your suggestions have some effect. For example, it seems the object was a group of 1 object. I didn't make that distinction previously, all I did was repeatedly attempt to ungroup the picture. As it turned out, after the 1st ungrouping, I saw the status line describe the object as clipped. I released it as per your response. That action revealed there was actually a black box sitting on top of the picture. I deleted the black box and the image looked normal, but the image extraction extension did not generate any PNG file. I applied Ungrouped again and the status line showed the object as masked. I released the mask and the object showed as inverted white on black (it should be the opposite). It did extract as a PNG, but in inverted white on black. I applied Filters->Color->Invert, which make it black on white again, but the extracted PNG was still white on black. Sometimes, depending on what things I tried in the many attempts at this, the image might disappear from the Inkscape file and show a big symbol indicated that a linked object could not be found.
Here is what did work, from trial and error. Do all the ungrouping, unclipping, and unmasking needed to get a raw image, and get rid of any extraneous boxes along the way (black or otherwise). Then apply Extensions->Raster->Negate followed by Extensions->Image->Extract to generate a PNG file. My guess as to why this works is that the embedded image is not changed by Filters->Colors->Invert, though the filter may be applied in presenting the display of the object to the Inkscape user on the screen or in generating a printout. In contrast, it seems that Extensions->Raster->Negate does change the underlying image.
About the matrix transformation that you suggested, I read up on what the parameters A, B, C, D are. It all corresponds to the theory I've seen for linear geometric transformations in a 2D plane. However, I suspect (though I've been wrong before) that the HTML manual has an error. They describe A=D=sin(theta) and B=-C=cos(theta). Under that scheme, a rotation of theta=0 (i.e. no net transformation) is specified as A=D=0 and B=-C=1. However, if you set the parameters this way, you actually get a rotation of pi/2 radians counter-clockwise (which is how rotations are traditionally measured in mathematics). Well sin(pi/2)=1 and cos(pi/2)=0. So it could be that a rotation is specified by A=D=cos(theta) and B=-C=sin(theta).
Thanks for your help.