Solved

How to write TIFF files in Java

Posted on 2009-03-29
7
1,310 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 410 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
Forrester Webinar: xMatters Delivers 261% ROI

Guest speaker Dean Davison, Forrester Principal Consultant, explains how a Fortune 500 communication company using xMatters found these results: Achieved a 261% ROI, Experienced $753,280 in net present value benefits over 3 years and Reduced MTTR by 91% for tier 1 incidents.

 

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 90 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

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Java basic valueOf question 1 35
swing controls 2 24
AWK: add from two digits (the month) within date string dd/mm/yyyy 2 23
Java array 21 88
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
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":…

730 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