T O P I C R E V I E W |
pierrotsc |
Posted - Dec 29 2011 : 20:39:47 I have an image that is 72 dpi. I am using the changeresolution command to change it to 360 dpi but i get an error that i do not have enough storage. Using imageen 3.1.2 can it be fixed? Thanks. P |
18 L A T E S T R E P L I E S (Newest First) |
pierrotsc |
Posted - Jan 02 2012 : 05:39:05 Got it...Works great now. Thanks for all the help. |
fab |
Posted - Jan 02 2012 : 04:11:58 quote: I think my mistake was to apply the new dpi to an imageenvect and then assigning it back to the original imageenvect. I think the assign command does not transfer the dpi. Am i correct?
No, it doesn't assign input/output DPI parameter. You should do:
ImageEnVect1.Assign( imageEnVect2 ); ImageEnVect1.IO.Params.DPI := ImageEnVect2.IO.Params.DPI; |
pierrotsc |
Posted - Dec 31 2011 : 18:51:55 I think my mistake was to apply the new dpi to an imageenvect and then assigning it back to the original imageenvect. I think the assign command does not transfer the dpi. Am i correct?
If i apply the new dpi to the main imageenvect, then it stays.
I was using the same example as the convertto demo project with the resize option. When you click on image size in the convertto demo, another form opens with the sizing info from the main imageenview passed to 2 new imageenview (before and after).
I was trying the same method but it looks like that does not work with dpi. P |
fab |
Posted - Dec 31 2011 : 16:38:00 Yes, you should see 300 dpi. You should see it in both cases (using ChangeResolution or just seting IO.Params.DPI property). |
pierrotsc |
Posted - Dec 31 2011 : 15:41:33 When i open an image with the imageenopendialog, there's a preview window. It displays the pixel size and the dpi. So when i click on an image that shows 3000x3000 pixels 72 dpi and I modify the dpi to 300 and save it, next time i open it I should see 3000x3000 pixels 300 dpi.
Are my assumptions correct? |
fab |
Posted - Dec 31 2011 : 14:35:06 quote: Let's see if i understand. I load an image at 72 dpi. I change the dpi to 300 but really nothing happens until i save the image and reload it. Correct?
Not exactly. The new dpi value is used on printing (printing preview).
quote: Now, could in save the image to a memory stream with the new dpi and reload it from memory to expect the new dpi to take effect?
This has no-sense. The new DPI value is always used (when it is used, i.e. on printing). |
pierrotsc |
Posted - Dec 31 2011 : 12:08:13 Let's see if i understand. I load an image at 72 dpi. I change the dpi to 300 but really nothing happens until i save the image and reload it. Correct?
Now, could in save the image to a memory stream with the new dpi and reload it from memory to expect the new dpi to take effect?
Thanks. P |
fab |
Posted - Dec 31 2011 : 11:40:12 quote: ...then i checked the dpi again by re opening my resize form and i was back at 72 dpi. nothing had changed.
Form DPI has nothing to do ImageEn DPI.
ImageEn DPI is just the value of the last loaded image. It is used only when you save back the image (to fill the relative DPI value inside a TIFF, jpeg, etc..) and it is also used on printing, using ImageEn printing functions.
|
pierrotsc |
Posted - Dec 31 2011 : 10:31:49 i tried but that did not work if i recall. i used imageenvect.io.params.dpi := 300; imageenvect.update;
then i checked the dpi again by re opening my resize form and i was back at 72 dpi. nothing had changed.
what i have is a loaded image. then i call the resize menu option that open a form like the resres form in the convertto demo. the form will display the current pixel sizes and dpi.
so when i close the resize form, i assign the imageenvect2 from the resize form back to the imageenvect from the main form. i assume that if i had change the dpi of the imageenvect2, it would then be passed onto the imageenvect.
when i re open the resize form, it still shows the original 72 dpi instead of 300.
if i have to save the image to apply the settings, i do not like that. so can i change the dpi of an image loaded in ram?
Thanks. |
fab |
Posted - Dec 31 2011 : 09:44:18 It makes sense (supposing you mean 3000x3000 pixels instead of 3000x3000 dpi). In this case you have to change only DPI parameter, as described, without call ChangeResolution. |
pierrotsc |
Posted - Dec 31 2011 : 06:36:18 Let's say i have a 3000x3000 pixels image at 300 dpi. that gives me a 10x10 inch image on paper printed at 300 dpi. If i change the dpi to 600 dpi, i would like to get a 5x5 inch image still at 3000x3000 dpi. Just like in Photoshop if you do not check the resample check box under the image size menu.
Am i making sense? Thanks. P |
fab |
Posted - Dec 31 2011 : 00:47:58 quote: So how can i change the Dpi (that means the document size will be altered but not the pixel size) without saving the image?
Please let me know what do you mean for "document size" and "pixel size". |
pierrotsc |
Posted - Dec 30 2011 : 16:48:02 You are correct. I do not know on how i missed that. It does also change the resolution.
So how can i change the Dpi (that means the document size will be altered but not the pixel size) without saving the image?
The width and height of the document are the pixel size / dpi.
I hope it can be done. Thanks. P |
fab |
Posted - Dec 30 2011 : 16:19:15 Of course it depends by what you need. Consider that ChangeResolution changes both DPI tag and actual image size. |
pierrotsc |
Posted - Dec 30 2011 : 16:04:55 That will not work. I do not want to save the image back. What about if the user wants to undo? It has to be done in memory. The changeresolution does that. It works when I switched the legacybitmap to false.
I'll dp more checking... Thanks. P |
fab |
Posted - Dec 30 2011 : 07:47:10 If you want only to change the image tag that contains DPI info, just write:
ImageEnView.IO.Params.Dpi := 300;
Then save back the image. |
pierrotsc |
Posted - Dec 30 2011 : 07:35:44 Well, this is not the effect i am trying to achieve. For example, the image is 3000x2000 at 72 dpi. I want to change the dpi but not resample. That means that right now the image is 40 in x 30in. If i change to 360 dpi, i still want the same pixel sizes but a file that is now 5 in x 4 in. (the values are approximated). That is why i use the changeresolution command and not the resample command.
I tried it on another file that was 300 dpi and switched it to 360. It worked as expected like i described above. The pixel sizes were not changed.
I will see about legacybitmap what it is set to. Thanks. |
fab |
Posted - Dec 30 2011 : 01:32:22 Changing resolution implies a resampling. If your image is 1000x1000 pixels (3MBytes) at 72dpi, changing to 360 dpi it will be 5000x5000 pixels (75MBytes), so make sure you have enough free memory. Consider also that TBitmap has a size limit, so you should use TIEBitmap instead. To use TIEBitmap just set:
ImageEnView.LegacyBitmap := false;
|