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
 Blocks appearing when loading jpeg in TImageEnView

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
Edelcom Posted - Feb 07 2012 : 09:24:28
Hi,

Could you please look at the screen dump I attached ?

You will see an jpg image loaded in PaintShopPro (to the left), and the same image loaded in TImageEnView (to the right). The image is a 600x600 pixel image from about 220K. Both are zoomed 400%.

The jpg is loaded with :
IO.LoadFromFile(s);

Can anyone explain why those block appear in the loaded image ?

I use this component in a image processing program for jewelry and although the saved image is ok (without the blocks), you can imagine that my users are not happy with the displayed image.

I really don't have a clue where to look.

I have an official licence for my company E.De.L.Com bvba - I am Erik De Laet

The image itself is attached. It was originally saved/re-scaled using TImageEnView as well.





Programmer by choice and profession.
9   L A T E S T    R E P L I E S    (Newest First)
Edelcom Posted - Feb 09 2012 : 10:10:03
Fabrizio,

Further tests and my users have confirmed that this was indeed the problem.
Thanks again for you help.

Erik

Programmer by choice and profession.
Edelcom Posted - Feb 08 2012 : 09:29:17
Fabrizio,

My first tests show that this indeed fixes the problem :) (don't know the smiley for big grin). I will do some further testing tomorrow.

I Had a similar issue with a Load/Crop/Copy to clipboard sequence (where the artifacts were shown after performing a copy to clipboard), but I have to make certain that my code does not save/load the picture somewhere between the load/crop and the copy to clipboard, before I bother you with this problem.

Once more, thanks for the support. It really is appreciated. I was really glad to see version 4 of the image component appearing. I upgrade my license immediatly. Receiving this kind of support make it all worth while. Thanks again. Erik

Programmer by choice and profession.
fab Posted - Feb 08 2012 : 09:11:23
Here is how I tested your image:
- create a new project
- put a TImageEnView component and a button
- in the button handler write:

ImageEnView1.IO.LoadFromFile(....);
ImageEnView1.Zoom := 400;

- now execute the application. No artifacts are shown.

Anyway, there is property that can cause this problem. It is JPEG_DCTMethod. It specifies the decoding method and could be used to speed-up loading, but with reduced quality.
The default should be ioJPEG_ISLOW, that specifies maximum quality but low speed.
If you set, for example, ioJPEG_IFAST you will see these artifacts.
So make sure (or force it) that ImageEnView.IO.Params.JPEG_DCTMethod = ioJPEG_ISLOW, before load the image.
Edelcom Posted - Feb 08 2012 : 08:57:16
Yes, the display is in true color.

But that is exactly my question: when I open it in my program (which uses an TImageEnView component, the artificats are shown.

Now, to be complete, I need to say that I do create the component by code, not at design time. Maybe I need to set some property ? Can this make a difference ?

I do appreciate your answers :)

Programmer by choice and profession.
fab Posted - Feb 08 2012 : 08:52:43
Hi,
I asked it because tests using that image do not show artifacts.

Is the display in true color (16M colors) mode?

Look at my result:

Edelcom Posted - Feb 08 2012 : 07:56:10
It's the top image in my question, or do you want me to email the image ?

Programmer by choice and profession.
fab Posted - Feb 08 2012 : 04:51:38
Please could you post this image?
Edelcom Posted - Feb 08 2012 : 04:30:56
Fabrizio,
Thanks for answering, but please reread my question.

The image which I attached, does not have the artifiacts (it was saved using TImageEnView with a quality of 100%).

Loading this picture in PaintShowPro shows the picture ok (screendump to the left), but loading THE SAME picture in TImageEnView shows the artificats. So as if the loaded picture is somehow downgraded a couple of quality points.

I really cannot explain this. So I was wondering whether where is some property or setting of TImageEnView which controls the quality of the display.




Programmer by choice and profession.
fab Posted - Feb 07 2012 : 09:43:31
Hi,
these are jpeg compression artifacts. You have to increase jpeg quality just before saving. For example:

ImageEnView.IO.Params.JPEG_Quality := 90;
ImageEnView.IO.SaveToFile('output.jpg');

You can even estimate the original jpeg quality and assign it to JPEG_Quality:

ImageEnView.IO.LoadFromFile('input.jpg');
ImageEnView.IO.Params.JPEG_Quality := IECalcJpegFileQuality('input.jpg');
...now do all processings...
...now save...
ImageEnView.IO.SaveToFile('output.jpg');