ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Convert colour jpeg to monochrome tiff

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
shackers Posted - May 09 2019 : 16:56:17
I am starting with a colour jpg file about 500KB in size. I want to reduce this considerably in size so I thought I would convert to monochrome tiff in the hope of reducing the file size to around 25-50KB.

So I try:
IEView.IO.LoadFromStreamJpeg(stream);
IEView.IO.params.ImageIndex:=0;
IEView.LegacyBitmap := false;
IEVIEW.IO.Params.TIFF_Compression:=ioTIFF_G4FAX;
IEVIEW.IO.params.BitsPerSample:=1;
IEView.IO.SaveToFileTIFF(myTiffFile);


I end up with a completely black page and a file size of 7.82MB.


What am I doing wrong please?
4   L A T E S T    R E P L I E S    (Newest First)
shackers Posted - May 13 2019 : 16:31:11
Perfect! Thank you.
xequte Posted - May 12 2019 : 17:27:39
Hi

What is your saving code? It should be something like:

// Save a monochrome TIFF image
ImageEnView1.IO.Params.BitsPerSample := 1;
ImageEnView1.IO.Params.SamplesPerPixel := 1;
ImageEnView1.IO.Params.TIFF_Compression := ioTIFF_G4FAX;
ImageEnView1.IO.SaveToFile('D:\output.tif');


Nigel
Xequte Software
www.imageen.com
shackers Posted - May 10 2019 : 06:26:25
Thanks.

I'm working with a text document.

I've looked at the demo for dithering.

A simple call to IEView.Proc.ConvertTo(ie1g) gets me a black and white text document, but when I save it as a tiff file I am large file sizes.

The original JPEG is 1MB

Without compression the saved tiff file is 62.5MB


With ioTiff_LZW it is 425KB.


I've tried with ioTIFF_G4FAX, but I just get a black document. I've worked with text documents with the G4FAX compression and I always get excellent results (would expect about 20-30KB for this document. I can't figure out why it doesn't work for this document.

What can I do to improve the compression please?


With a plain text
xequte Posted - May 09 2019 : 17:22:40
Hi

Setting BitsPerSample is not enough to make an image monochrome. You also need to adjust the SamplesPerPixel and downscale the color content.

Firstly, what is the content of the JPEG image? Is it a document?

Please try the dithering demo to get a better understanding of color reduction options:

https://www.imageen.com/demos/index.html#ImageEditing

Nigel
Xequte Software
www.imageen.com