From koffice-devel Wed Oct 30 07:42:58 2002 From: Vadim Plessky Date: Wed, 30 Oct 2002 07:42:58 +0000 To: koffice-devel Subject: Re: The road goes ever on X-MARC-Message: https://marc.info/?l=koffice-devel&m=103596459908537 On Tuesday 29 October 2002 10:00 pm, Dirk Schönberger wrote: | > Let's take, for example, high-quality and small in size image (attached, | > web-spider-rsvg.png). It is 23K. I generated it using librsvg-2.1.1, | > from SVG file (4.4K, it is also attached). | > | > I have tried several paths to convert this image to PS (EPS is PS with | > bounding box). | > | > 1) First I converetd it using latets stable release of Imagemagick | (5.5.1): | > ..... | | Ouch. I think I understand what you did, but I still don't think it is the | right tool for the job. | The idea behind what you did is using EPS as some kind of "container" for | the actual image / bitmap data. This is possible, but it should only used | for outputting to a real Postscript printer. You don't convert the image | data to vector data, but instead convert the image data from its | compressed form as PNG to an uncompressed form which is uncompressed form | useable by a printer. You haven't mentioned that you want to convert image to *vector format*! | | This way is also done by the other tools you mentioned. | | For conversion to vector data you need more specialized tools, like e.g. | Adobe Streamline or something like the Open Source "autotrace" project | (somewhere on sourceforge, IIRC. Yes, there is an Open-Source autotrace, which also can be used by ImageMagick, BTW (if it is installed). But do you really wnat to *autotrace* PNG or JPEG, during export to Latex?.. Anyway, there is a way to have automatic ratser->vector "losssless" conversion. But this would produce *huge* output files! You take your image, and convert *each pixel* to rectangle, than position each pixel one after another. Rectangle would have default RGB value of that pixle as 'fill', and no border (stroke:none). For the reference image which I used this would produce: 160x160=25600 rectangles. It would be interesting to see png2svg utility doing this job. (which would greatly complement Karbon14' set of tool, IMO) I guess 'rect' primitive is ok for this task, no need to use 'path' Such approach even would allow scaling for those pseudo-vector images. If you use scaling factor of 3X, you need just to replace solid fill with linear gradient, and you will get smoothing/scaling working for raster imeges! // high-end PS interpreter does scaling of images exactly in such way, BTW. | | > | I don't think Ghostscript is the right tool for this job, because its | main | > | goal is mostly reversed, i.e. the conversion of vector data / | Postscript | > | calls to a rendered image. | > | > GS is not "right tool" for any task, but until we have couple of good | > SVG renders compliant with SVG 1.1, and QT patched to produce SVG | > instead of | PS | > (WSVGprinter class), we need to "live with GS". | | What do you want to achieve? From what I understand, SVG is more suited to | "clip art", i.e. one page, or a small area thereof, similar to EPS. Real | Postscript files mostly contain multiple pages. Com'on, SVG is XML-based. You always can have a wrapper around several SVG images, in XML format. The easiets way to achieve this is to use XHTML+CSS, or XML+CSS, with paged media (@media page) | I think Karbon14 contains a nice substitute for a SVGPrinter class, but | this implies using Karbon's VPainter API instead of QPainter. Yes, Karbon14's progress is very impressive! | > | > Forget about Qt for Vector graphics. | > AFAIK Qt is limited by QPainter, so you can't expect from QT something | which | > exceeds its capabilities. | > That's why there is a KSVG, while Qt3 has support for (rudimentary in | > complexity) SVG files. | > This question has been asked, and Trolls answered that they are not | > going | to | > provide reference SVG implemenattion inside QT3. | | Again, I think Karbon provides a nice rendering model similar to | Postscript / PDF and SVG. The problem is, that the Karbon developers have | not enough free resources to use the VPainter API outside of the actual | Karbon. Please feel free to evaluate the API and nag the Karbon developers, | like Rob Buis, for feature enhancements. Please be prepared to get told "do | it yourself :)" Thanks, I send bug reports to Rob already for some time! :-) | | Regards | Dirk | _______________________________________________ | koffice-devel mailing list | koffice-devel@mail.kde.org | http://mail.kde.org/mailman/listinfo/koffice-devel -- Vadim Plessky http://kde2.newmail.ru (English) 33 Window Decorations and 6 Widget Styles for KDE http://kde2.newmail.ru/kde_themes.html KDE mini-Themes http://kde2.newmail.ru/themes/ _______________________________________________ koffice-devel mailing list koffice-devel@mail.kde.org http://mail.kde.org/mailman/listinfo/koffice-devel