Solved

convert a tiff image to jpeg or load into a timage

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Delphi application Soap connection 5 120
delphi parse string to params 3 136
SUM 2 INTEGER ARRAYS INTO 1 10 108
update joined tables 2 55
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Technology opened people to different means of presenting information, but PowerPoint remains to be above competition. Know why PPT still works today.
In this Micro Tutorial viewers will learn the basic shortcuts and functions of Illustrator. The viewer will learn about the paintbrush tool, anchor points, font sizing, and more.
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…

861 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