How to write TIFF files in Java

I'm trying to make a java console application that can create, modfty .tif files
For example, if the input is "Arial, 12, Hello World, 000000, 100, 100, ffffff", it would create a 100x100px .tif file with white(#ffffff) background containing black(#000000) Arial text saying "Hello World" in the font size of 12pt. (in separate layers)

Is this even possible? If not, are there any other ways to get similar result?

Thanks.
daeyunAsked:
Who is Participating?
 
InteractiveMindConnect With a Mentor Commented:
The standard Java library does not support TIFF. But there are some libraries you can download to handle TIFF files.
Sun have created the Java Advanced Imaging library (http://java.sun.com/products/java-media/jai/iio.html), but that seems like overkill. So try this library: http://www.lizardworks.com/java.html
0
 
InteractiveMindCommented:
(I'd suggest using regex (specifically the String#split() method) to separate the required information from the input string. Then once you've parsed it, use the above library. Shouldn't be too hard.)
0
 
Thomas4019Commented:
Does it really need to be a TIFF file.
JPG, GIF, PNG, BMP are all very easy to create with Java. TIFF files are not.
0
Get 10% Off Your First Squarespace Website

Ready to showcase your work, publish content or promote your business online? With Squarespace’s award-winning templates and 24/7 customer service, getting started is simple. Head to Squarespace.com and use offer code ‘EXPERTS’ to get 10% off your first purchase.

 
daeyunAuthor Commented:
What I need to do is separating the background and the text by layers, so it can be editable in programs like Photoshop..
Are there easier way to do this?
0
 
Thomas4019Commented:
Can your Photoshop import either WMF,EMF,or SVG files. These are all text based file formats and can be outputted easily. I am fairly sure the only way to write TIFF files is to use a library that extends this functionality to Java. These libraries can be alot of work to learn.

Or an alternative is to create a transparent Background PNG with the text, then in photoshop you could add the background. So basically export in a raster format and not include the background. With this way you would have to add the background color in Photoshop.
0
 
daeyunAuthor Commented:
no,
I think FXG, PSD, PDD and TIFF are the only formats that support layers in photoshop.
0
 
Thomas4019Connect With a Mentor Commented:
My recommendation is write it a Java program that only creates the foreground. To create this image you would use BufferedImage, Graphics, and ImageIO. What is your experience with Java?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.