I want to create pdf, svg and hi-res antialiased img using Java.
The java-gnome project (http://java-gnome.sourceforge.net/4.0/) contains cairo
bindings, but there are problems using it on xp because of the multithreaded gtk
incompatibilities with xp...
Any of you guys that have successfully been using java-gnome cairo stuff compiling on xp?
Are there other java solutions/libraries that can handle the same stuff with the same
quality?
The Apache Batik toolkit is an implementation of SVG built on the Java 2D library: http://xmlgraphics.apache.org/batik/
One can say objectively that it is one of the best, most complete implementations of SVG: http://www.codedread.com/svg-support.php (it's at the bottom of the table)
You can use it to render PDFs (as well as PNGs and other bitmap formats) using the SVG rasterizer component: http://xmlgraphics.apache.org/batik/tools/rasterizer.html
I can also say from personal experience that it has very easy to work with, although I haven't used it very much on Windows.
Related
I was wondering what tool can I use to make a single slice (image) into 3D. I can open dicom and raw images in my program but I want to display these images in 3D (just a single image rather than the whole stack). I used some of ImageJ files to open images but I don't like how ImageJ displays the stack in 3D and it doesn't really display a single image in 3d. My program is coded in java and I would like a tool that can be easily integrated into eclipse Kepler. I have found many tools like jogl, java 3d, java 3d workbench, vtk, etc. but I don't know which one to use or are there any other programs that are easier to use or integrate into the system.
EDIT:
I want to do something like this... http://www.welfenlab.de/fileadmin/forschung/gebiete/YaDiV/2008_07_18_Screenshot_YaDiV_1.png
There's a library called ImageJ which can be used to create three-dimensional models from two-dimensional slices. I haven't personally used it, but it looks like it should do the trick.
have you looked at XTK? in particular, lesson 17 seems to be exactly what you are looking for. it is in Javascript, so to integrate into your Java application, you should be able to use one of the many Java/Javascript bridges out there.
Im trying to check how to generate TIFF using JAVA libraries. I checked JAI, but it requires native libs that I can't use in my project (it must be platform-independent).
I saw a great library, Apache Commons Imaging that generates successfully TIFF, I tried and ...its good.
But I didnt see any way to create TIFF with several pages.
Is there any way to do this?
Thanks!
You can do it with icafe Java library (disclaimer: I am the author of this library). No dependency on any native stuff. Look at the wiki page for item Create multipage TIFF image for example. You can also control the color type and compression method for different pages. Dithering can be set through parameters in case color quantization is required such as saving images to black and white using CCITT group3/group4 compression. The resulting multipage image from the wiki page can be found here.
Is it possible to convert a BufferedImage to scalable vector graphic (SVG) in java? Is there any java library to do so?
I have found Batik useful for converting SVG files to other formats (for example here) but not the other way around.
Also in cases of Potrace and its java implementation delineate i need to install the software, whereas i am looking for a library jar which i can just import and use in my project.
Suggestion for any such library will be highly appreciated.
Batik will allow you to 'embed' a BufferedImage within an SVG file. Here's an example.
Note that a BufferedImage is already a rastered bitmap, however, and will necessarily pixelate as you resize the SVG image. If you're seeking the benefits of image scaling without pixelation, you'll need to go to the extra effort of "redrawing" the image with the Batik API.
Can anyone provide me with an example program for reading an svg file.
You might want to look at the Batik SVG Toolkit:
Batik is a Java-based toolkit for applications or applets that want to use images in the Scalable Vector Graphics (SVG) format for various purposes, such as display, generation or manipulation.
We have a java web application. The application generates a big image with company structure diagramm on it as jpeg. Users download the image and want to print it on DIN A2 (big paper format). The jpeg in this scale has pretty bad quality after printing.
Our idea is to generate an image in vector graphics. What vector graphics format suits the best our needs, considering that we code in java and the users have windows and use MS IE browser?
May be there is a better way archieve this? Like let the browser to display the image and let users to print the page?
PDF has been invented exactly for the same purpose. iText library enables you to draw lines, boxes, circles and insert whatever text you like. If you want to automate it a bit using templates there's JasperReports which utilizes iText.
A well known vector graphics format is Scalable Vector Graphics. It's basically an XML file (starting with <svg> tag. It can be viewed in browsers like Firefox without additional plugins.
For java, you can use the Java 2D API to create SVG format. A tutorial can be found here:
If you need the vector graphic for IE you need VML, similar to SVG but can be rendered by Internet Explorer.
RaphaelJS can be used for vector graphics independent of browser model but it's client side and you may not want to do client side processing on every page load.