?
Solved

How to write TIFF files in Java

Posted on 2009-03-29
7
Medium Priority
?
1,333 Views
Last Modified: 2012-05-06
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
Comment
Question by:daeyun
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
7 Comments
 
LVL 25

Accepted Solution

by:
InteractiveMind earned 1640 total points
ID: 24013809
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
 
LVL 25

Expert Comment

by:InteractiveMind
ID: 24013819
(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
 
LVL 17

Expert Comment

by:Thomas4019
ID: 24014733
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 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

 

Author Comment

by:daeyun
ID: 24015672
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
 
LVL 17

Expert Comment

by:Thomas4019
ID: 24015704
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
 

Author Comment

by:daeyun
ID: 24015739
no,
I think FXG, PSD, PDD and TIFF are the only formats that support layers in photoshop.
0
 
LVL 17

Assisted Solution

by:Thomas4019
Thomas4019 earned 360 total points
ID: 24015769
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

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A quick Powershell script I wrote to find old program installations and check versions of a specific file across the network.
The Windows functions GetTickCount and timeGetTime retrieve the number of milliseconds since the system was started. However, the value is stored in a DWORD, which means that it wraps around to zero every 49.7 days. This article shows how to solve t…
Learn how to create interesting presentations by including videos to keep your audience engaged using Prezi. Select "Insert" from the top menu in your Prezi editor: Select "YouTube Video": Paste the video URL into the prompt: "Select "Insert":…
It’s easy to embed any of your public Prezi presentations on your website or social network to share with others. Learn how simple it is in this tutorial.
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question