Solved

convert a tiff image to jpeg or load into a timage

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

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

Join & Write a Comment

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…
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 how to remove an unwanted object using Photoshop’s feature known as content-aware fill.
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…

743 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

13 Experts available now in Live!

Get 1:1 Help Now