resolution in cm??? Help I need dpi

Corel Paint Shop Pro

Moderator: Kathy_9

JoeB
Posts: 2778
Joined: Fri Mar 28, 2008 10:04 pm
operating_system: Windows 8.1
System_Drive: C
32bit or 64bit: 64 Bit
motherboard: LENOVO 4524PE4 ThinkCentre M91p
processor: 3.10 gigahertz Intel Quad Core i5-2400
ram: 8 GB
Hard_Drive_Capacity: 4.6 TB
Corel programs: PSP 9, X7 to 2019, 32 & 64-bit
Location: Canada

Re: resolution in cm??? Help I need dpi

Post by JoeB »

Brilliant, LeviFiction! The script does exactly what I was looking for. To start with, I just added the interactive code at the end so that after the calculation is done then the script automatically opens the Image Information dialogue. This way, if bound to an icon, the bound script can replace the Image Information menu item. That's because if you run the script on an image that presently shows metric it will automatically convert the image to imperial. And if you run it on an image already in imperial it won't change anything at all. This means you don't have to first ascertain whether or not the subject image is showing metric units and then have to run the script to convert to imperial. Using the script - with the added Image Information coding - means it can be used instead of the Image Information menu item because with the script Image Information will open ALWAYS showing imperial units regardless of what the original units were. I always found it irritating to open Image Info and find I had to convert - one way or another - the units to imperial to know at a glance what the image properties were - and of course that extra step meant the information I wanted wasn't available "at a glance". Now one click on my bound script icon opens Image Info and I'll always see imperial units.

And, of course, as you have made the script editable to show always show metric instead, those who want their Image Information dialogue to always show metric instead can make a couple of small changes and use the script to achieve that also.

You should sell the idea to Corel. They could make the Image Information dialogue selectable - i.e., users could choose whether they always want Image Information displayed in metric units or always in imperial units (my preference for graphic work). In the meantime, the modified script, bound to an icon on my menu bar (where I had previously moved the Image Information button to) does the trick. A real one-click solution to open the Image Information dialogue with all info in imperial units (inches).

P.S. While it might only be me - and perhaps the OP - who might find this useful, seeing as the script does provide a useful if specialized solution to something that might appeal to at least some users, perhaps you should consider posting it in the Scripting sub-group. Just a thought.

EDIT P.P.S.: I also appreciate the info about adding runSilent to the Environment variable. All these little tips add up!
Regards,

JoeB
Using PSP 2019 64bit
LeviFiction
Advisor
Posts: 6831
Joined: Thu Oct 02, 2008 1:07 pm
operating_system: Windows 10
System_Drive: C
32bit or 64bit: 64 Bit
motherboard: Alienware M17xR4
processor: Intel Core i7-3630QM CPU - 2_40GH
ram: 6 GB
Video Card: NVIDIA GeForce GTX 660M
sound_card: Sound Blaster Recon3Di
Hard_Drive_Capacity: 500GB
Corel programs: PSP: 8-2023
Location: USA

Re: resolution in cm??? Help I need dpi

Post by LeviFiction »

I'm glad you found it useful, it's not even production ready code. xD Just something I threw together as an example of a potential script.

Instead of uploading it as its own script I simply added it to the ChangeResolution scripts I pointed to previously. I've called it ChangeResolutionUnits. And just like the other two scripts it uses the Units defined in General Preferences to determine what units it should be converting to. This way people don't have to edit the script or have two different versions.

viewtopic.php?f=104&t=60496
https://levifiction.wordpress.com/
JoeB
Posts: 2778
Joined: Fri Mar 28, 2008 10:04 pm
operating_system: Windows 8.1
System_Drive: C
32bit or 64bit: 64 Bit
motherboard: LENOVO 4524PE4 ThinkCentre M91p
processor: 3.10 gigahertz Intel Quad Core i5-2400
ram: 8 GB
Hard_Drive_Capacity: 4.6 TB
Corel programs: PSP 9, X7 to 2019, 32 & 64-bit
Location: Canada

Re: resolution in cm??? Help I need dpi

Post by JoeB »

LeviFiction wrote:I'm glad you found it useful, it's not even production ready code. xD Just something I threw together as an example of a potential script.

Instead of uploading it as its own script I simply added it to the ChangeResolution scripts I pointed to previously. I've called it ChangeResolutionUnits. And just like the other two scripts it uses the Units defined in General Preferences to determine what units it should be converting to. This way people don't have to edit the script or have two different versions.

viewtopic.php?f=104&t=60496
Good idea, although I'm personally happy to have the script as the standalone it presently is. And I thought we would have to uncomment the unit we wanted to keep, so I guess I misunderstood the comment - or misunderstood something else further into the script. Not surprising for me. :-)

But I do have another question.

I do rely on one thing that the Resize dialogues default to so that I don't have to change them, and that is the fact that if you last used Resample Using then that will be checked the next time you use the Resize dialogue.

If I understand the script correctly, it only changes the resolution units without any resizing (print size or pixels) whatsoever. Would I then be correct then in assuming that, even if Resample Using in the Percentage tab was checked, along with Smart Size (my preference for default), then using the script wouldn't actually cause any resampling because none of the actual sizes were changed?

I ask because the script causes the Percentage tab to uncheck Resample Using. So if I do an actual resize on another image using the Percentage tab I have to re-check that box instead of it defaulting to what I normally use. So I was thinking of adding the following to the Resize code in the script to keep Resample Using and Smart Size active when I use Percentage any time after running the script to just do a units conversion:

'Resample': True,
'AdvancedMode': True,
'ResizeType': 2,

It doesn't seem to cause any problems for me when I modify the script with it, and those options are still shown as the defaults with the modifications when I just use the Resize>By Percentage item on other images after I've run the script on a png/metric units image. But I wanted to be sure that your script didn't really do any actual resampling - and thus causing some digital data degradation - even if those options were checked. Thanks in advance!
Regards,

JoeB
Using PSP 2019 64bit
LeviFiction
Advisor
Posts: 6831
Joined: Thu Oct 02, 2008 1:07 pm
operating_system: Windows 10
System_Drive: C
32bit or 64bit: 64 Bit
motherboard: Alienware M17xR4
processor: Intel Core i7-3630QM CPU - 2_40GH
ram: 6 GB
Video Card: NVIDIA GeForce GTX 660M
sound_card: Sound Blaster Recon3Di
Hard_Drive_Capacity: 500GB
Corel programs: PSP: 8-2023
Location: USA

Re: resolution in cm??? Help I need dpi

Post by LeviFiction »

Those changes should be fine. I don't mention it in the video below but I added those parameters to the Resize command in the script to make sure they would work.

As far as I know no pixel edits are done. If Corel's developers are smart, and we know that they are, they would do what I did with this script and avoid any unnecessary edits such as resampling an image that doesn't change at all.

If you wanted to double check you could always use the Arithmetic command, set to Subtract and see if the resulting image includes anything but the color black. The steps are this

1) Open Image
2) Duplicate Image
3) Perform Resolution Change
4) Perform arithmetic - Subtract - All Channels - Divisor 1 - Bias 0 - Clip colors deselected If after subtraction they are less than zero we want them to flip around to white.
5) Image -> Count Image Colors

If Color count is 1 - no changes have been made as the only way to get a solid black is for each pixel to be exactly the same color between both images, or, at the very least

And Video demo: https://drive.google.com/file/d/1Pb9VFO ... 93A1G/view
https://levifiction.wordpress.com/
JoeB
Posts: 2778
Joined: Fri Mar 28, 2008 10:04 pm
operating_system: Windows 8.1
System_Drive: C
32bit or 64bit: 64 Bit
motherboard: LENOVO 4524PE4 ThinkCentre M91p
processor: 3.10 gigahertz Intel Quad Core i5-2400
ram: 8 GB
Hard_Drive_Capacity: 4.6 TB
Corel programs: PSP 9, X7 to 2019, 32 & 64-bit
Location: Canada

Re: resolution in cm??? Help I need dpi

Post by JoeB »

Thanks again. Glad to have confirmation, and I appreciate the info about how to use arithmetic to check for changes in image data. That's something I may have heard about long ago but had completely forgotten. And I certainly wouldn't have remembered the procedure!
Regards,

JoeB
Using PSP 2019 64bit
Locked