Solved

How to write TIFF files in Java

Posted on 2009-03-29
7
1,301 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
  • 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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Technology opened people to different means of presenting information, but PowerPoint remains to be above competition. Know why PPT still works today.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

757 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now