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

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Problems in Change Resolution
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

yogiyang

India
727 Posts

Posted - Apr 29 2016 :  07:29:35  Show Profile  Reply
Hello,

I have run into problem when using ChangeResolution procedure.

To demonstrate the problem I have uploaded a sample project along with image files.

Please download it from here: https://www.dropbox.com/s/018anhlvrkomrzx/ChangeResolutionSample.7z?dl=0

What is the problem?
I am trying to change resolution of loaded multi layer PSD from 200 dpi to 300 dpi, using ChangeResolution procedure.

The problem is that when we use this procedure and have multiple layers it moves all the layers close to each other (or rather towards left) from their current location.

How to solve this problem?

TIA


Yogi Yang

xequte

38611 Posts

Posted - May 01 2016 :  14:30:20  Show Profile  Reply
Hi Yogi

ChangeResolution resamples (resizes) the image. If you just want to set the DPI uses:

ImageEnView1.IO.Params.DpiX := 300;
ImageEnView1.IO.Params.DpiY := 300;

Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page

yogiyang

India
727 Posts

Posted - May 02 2016 :  01:20:17  Show Profile  Reply
Hello Nigel,

You are right. But then it just seems to change the resolution of the background layer (Layer 0) only. It does not seem to touch other layers.

But setting
ImageEnView1.IO.Params.DpiX := 300;
ImageEnView1.IO.Params.DpiY := 300;

Will only set the info it will actually convert the image to 300 DPI.

Again if we use Change Resolution on an image and then save that image and open it in photoshop and observe then the physical dimensions of the image are reduced and packing of pixels has become more denser. Please check this for your self in the demo provided.

Open the original file in any image editor that supports opening PSD file and check its size. Now process the files in the demo and save the file under new name as PSD file and open it in image editor and you will observe that the width and height have reduced if we increase DPI and enlarges if we decrease DPI.

How to solve this problem?

TIA


Yogi Yang
Go to Top of Page

xequte

38611 Posts

Posted - May 02 2016 :  17:15:49  Show Profile  Reply
Hi Yogi

Please note that DPI has no practical purpose, it is simply advice. It means for each pixel in my image, what is it size in the real world. For example, if we have two images 1000x1000 pixels, but one is DPI 150, and ther other 300 they are completely the same, except that when printed one will be printed twice as large.

When you use ChangeResolution() instead of setting the DPI, you are actually resampling (resizing) the image, i.e. physically changing it (generally not for the better).

So ensure you are using DPI for the right reasons.

Regarding this particular issue, using ChangeResolution does not update the position of the layers. I will investigate this for the next update.



Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page

xequte

38611 Posts

Posted - May 02 2016 :  18:46:20  Show Profile  Reply
Hi Yogi

I have an update that will correctly reposition the layers (though I still don't recommend use of ChangeResolution).

Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page

DMC02766

USA
27 Posts

Posted - Aug 18 2016 :  17:45:17  Show Profile  Reply
Just found this post while working with 6.3.0. I'm seeing that if I save a file (starting at 96 dpi) without layers it stays the same but if I add a layer then save it, it is then loading the layer image file as 300 dpi regardless as to what it started with.
Go to Top of Page

yogiyang

India
727 Posts

Posted - Aug 21 2016 :  02:15:19  Show Profile  Reply
Yes that is the situation but I think it is by design.

Yet Nigel can only give the final word on this.


Yogi Yang
Go to Top of Page

xequte

38611 Posts

Posted - Aug 21 2016 :  18:49:50  Show Profile  Reply
Hi

Layers will take on the DPI of the container image.



Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: