Solved

convert a tiff image to jpeg or load into a timage

Posted on 2006-10-30
2
2,948 Views
Last Modified: 2013-11-19
easy, question:

convert a tiff image to jpeg or load into a timage

i asked in other forum too but by moment not good answers, i know that exist efgs webpages and other.....

http://www.delphipages.com/threads/thread.cfm?ID=173914&G=173914

but by moment, not code for try convert..

thanks
0
Comment
Question by:jamiguel
2 Comments
 
LVL 17

Assisted Solution

by:Wim ten Brink
Wim ten Brink earned 20 total points
ID: 17840455
Basically, load the TIFF image in a graphic class that can handle TIFF images, create a new JPG graphic object with the same width and height as the TIFF image and then draw the TIFF file on the JPG canvas. Basically, that's one way to convert a TIFF to a JPG.
Then again, depending on the graphics classes used in your code, you might even use something like TJPeG.Assign(TTIFFGraphic) which might do the convertion for you. Or not. It's just that there are quite a few options for this and all of them have their pro's and cons.

http://www.soft-gems.net/Graphics.php is a good library...
0
 
LVL 9

Accepted Solution

by:
bernani earned 30 total points
ID: 17979542
Hi,

TIFF in Delphi, pre-compiled LibTiff for Borland Delphi - See
http://www.awaresystems.be/index.html
http://www.awaresystems.be/imaging/tiff/delphi.html

look at the thread
http://www.asmail.be/msg0055535082.html wich gives you:

Unit LibTiffDelphiHigherLevel;

interface

uses Windows, SysUtils, Classes, Graphics, Controls, Forms, LibTiffDelphi; {uses LibTiffDelphi, download it here: http://www.awaresystems.be/imaging/tiff/delphi.html }

function ReadTIFFFileIntoBitmap(Filename: String): TBitmap;
procedure VisualizeTIFFFileInImage(Filename: String; Image: TImage);

...

procedure VisualizeTIFFFileInImage(Filename: String; Image: TImage);
var
m: TBitmap;
begin
  try
  m:=ReadTIFFFileIntoBitmap(Filename);
  Image.Picture.Assign(m);
  m.Destroy;
 except
 Image.Picture.Assign(nil);
 end;
end;

Create a TJpegImage and assign before saving as jpg.

Sample to read and write a tiff :
http://esibert.developpez.com/delphi/libtiff/


http://delphipage.free.fr/formats.html

http://delphipage.free.fr/programmes/tiff2bmp.zip
http://delphipage.free.fr/programmes/bmp2tiff.zip


See also:
http://studio.imagemagick.org/script/index.php
and
http://www.cit.gu.edu.au/~anthony/graphics/imagick6/formats/#vector : Typical conversion problem JPEG to TIFF...

and maybe also: http://www.logicnet.dk/lib/

ImageFileLib
Version 1.16, 2005-10-09
Freeware, full C++ and Delphi source included
Download from SourceForge.net
With this library, Delphi programs can read and write BMP, JPEG, JPEG 2000, PNG, MNG, TIFF, ICO, CUR and PCX images. RAS, PNM, PGM, PPM, HIPS images can be loaded, but not created. This version was tested with Delphi 7, but should also work with 5, 6 and 2005. It is based in part of my own code and implementation of some of the file formats, and in part on other freeware image processing libraries.

__________________________________

Hope this can help to read, write and convert from one format to other

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Convert Jpg /PNG To GIF 5 120
VCD to mp4 11 134
LAN or WAN ? 11 82
Need Help Delphi 2010 CheckBox1 Stored value in memo 13 57
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Keep your audience engaged and get the most out of your next presentation with these quick Prezi tips.
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

864 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

25 Experts available now in Live!

Get 1:1 Help Now