Solved

convert a tiff image to jpeg or load into a timage

Posted on 2006-10-30
2
2,968 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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Delphi : could not find program, '...exe' 2 168
Delphi - replicating a form 8 73
how to send memory stream from ics Client To ics server ? 11 105
SUM 2 INTEGER ARRAYS INTO 1 10 100
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Many programs have tried to outwit PowerPoint in terms of technology and skill. These programs, however, still lack several characteristics that PowerPoint has possessed from the start. Here's why PowerPoint replacements won't entirely work for desi…
Learn how to download your full Prezi presentation for offline presenting. Prezi doesn’t have to be viewed and shared in a web browser, even with a free account you can download your full presentation to share with others. Be sure to download any vi…
Learn how to use the remote presentation tool in Prezi to allow you to harness the power of this cloud based presentation platform. You can show your presentation with a remote audience using this free tool.

776 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