• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1397
  • Last Modified:

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.
0
daeyun
Asked:
daeyun
  • 3
  • 2
  • 2
2 Solutions
 
InteractiveMindCommented:
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
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
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
 
Thomas4019Commented:
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.

Join & Write a Comment

Featured Post

Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

  • 3
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now