How do I "detube" an image?

Corel Paint Shop Pro

Moderator: Kathy_9

Post Reply
Carolrob
Posts: 10
Joined: Wed Mar 07, 2012 9:20 am
operating_system: Vista Home Premium
System_Drive: C
32bit or 64bit: 64 Bit

How do I "detube" an image?

Post by Carolrob »

I have many large png images that have 6+ images on them. What is the easiest way to save each image individually from the large image? I have been
selecting image/copy/save as new image. I'm hoping there is a faster way. I have attached an example but I had to resize it for posting here.

Carol
Example resized.png
Radim
Posts: 712
Joined: Mon Nov 01, 2010 5:54 pm
operating_system: Windows 10
System_Drive: C
32bit or 64bit: 64 Bit
ram: 4GB
Monitor/Display Make & Model: 27 inch

Re: How do I "detube" an image?

Post by Radim »

Few steps below.
Attachments
detube.png
User avatar
Ken Berry
Site Admin
Posts: 22481
Joined: Fri Dec 10, 2004 9:36 pm
operating_system: Windows 11
System_Drive: C
32bit or 64bit: 64 Bit
motherboard: Gigabyte B550M DS3H AC
processor: AMD Ryzen 9 5900X
ram: 32 GB DDR4
Video Card: AMD RX 6600 XT
Hard_Drive_Capacity: 1 TB SSD + 2 TB HDD
Monitor/Display Make & Model: Kogan 32" 4K 3840 x 2160
Corel programs: VS2022; PSP2023; DRAW2021; Painter 2022
Location: Levin, New Zealand

Re: How do I "detube" an image?

Post by Ken Berry »

I hate to say it but it seems to me that CarolRob's method would be faster...
Ken Berry
photodrawken
Posts: 684
Joined: Wed Sep 26, 2012 8:40 am
operating_system: Windows 10
System_Drive: C
32bit or 64bit: 64 Bit
ram: 16Gb
Hard_Drive_Capacity: 324Gb
Location: USA

Re: How do I "detube" an image?

Post by photodrawken »

Use the Crop tool, selecting its "Crop as new image" option.
Ken
Yes, I think it can be eeeeeasily done...
Just take everything out on Highway 61.
Cassel
Posts: 1587
Joined: Fri Oct 29, 2010 6:49 pm
operating_system: Windows 10
System_Drive: C
32bit or 64bit: 64 Bit
ram: 16Gb
Corel programs: PSP 8 (JASC) to PSP 2023
Location: Canada
Contact:

Re: How do I "detube" an image?

Post by Cassel »

If you don't mind each wing to be separate and if you are starting with a png format (not a jpg), you might want to get this tool:
http://creationcassel.com/store/index.p ... ucts_id=65
It will separate each individual element into separate image.
Cassel
https://creationcassel.com/store
Specializing in PSP specific products: scripts and tubes

https://scrapbookcampus.com
for beginner and seasoned scrappers and designers and other PSP users
User avatar
hartpaul
Advisor
Posts: 2893
Joined: Tue Mar 20, 2012 3:38 pm
operating_system: Windows 10
System_Drive: C
32bit or 64bit: 64 Bit
motherboard: ASUSTeK P7P55D STRIX B240F GAMING
processor: IntelCore i7 7700 3.60 Ghz
ram: 8 Gb
Video Card: Nvidia GeForce GTX 1050
sound_card: Nvidia High Definition Audio
Hard_Drive_Capacity: 1000 Gb
Monitor/Display Make & Model: AOC
Corel programs: PSP8,X2 to X9,2018,2019,2020
Location: Australia

Re: How do I "detube" an image?

Post by hartpaul »

Just tested this way in PSPX4
1 Started with image 6 butterflies on transparent background. (Dragged a butterfly picture tube onto the workspace)
2. Chose the largest image and drew a selection rectangle around it.
3. Control Shift P (promotes that selection (image) to a new layer) and this does not drop the selection.
4. Activate the group image layer and using the right mouse button drag the selection to the next image.
5. Repeat 3 and 4 for all the images.

You should now have the group image on the bottom layer and in my case the 6 promoted butterfly images layers above it.

6. In turn Activate each of the butterfly image layers and drag the thumbnail onto the workspace. This will make a copy of that image AND make the most efficient crop.
7. Close all of the images apart from the newly cropped images.
8. Window > Close All will then give you the option of saving the images (all or can even untick some).
9. Make new folder (or navigate to prepared folder) , make sure you are saving as png to maintain transparency and then click Save (Do this the number of times for the images) This will save each as Image1, image2, image3 etc you can then bulk rename these Butterfly 1, butterfly 2 etc (in my example) .

Although this is long to explain it shortens the process you were using in that you do not have to type in a different name individually, and you do not have use 6 dialog boxes, and you get an efficient crop.
Test it and any other methods that are suggested and please report back with the simplest most efficient method as others may want the same result.
Systems available Win7, Win 8.1,Win 10 Version 1607 Build 14393.2007 & version 20H2 Build 19042.867
Radim
Posts: 712
Joined: Mon Nov 01, 2010 5:54 pm
operating_system: Windows 10
System_Drive: C
32bit or 64bit: 64 Bit
ram: 4GB
Monitor/Display Make & Model: 27 inch

Re: How do I "detube" an image?

Post by Radim »

Best way is Scripting. On image in #1 post two parts of the wings has to be together. So it has to be selected manualy(?).

So simply put script (http://paintshop.php5.sk/SaveSelectionAsPNG.PspScript) to "Scripts-Trusted" folder + set in script your output folder and follow two steps:

1) select part of image
2) apply script (to Copy selection - Paste as new image - Crop empty borders - Auto save as PNG - Close image ... in one step) :D

Code: Select all

# Before use in 'PaintShop Pro X6' change value to existing output dir on line 121!

from PSPApp import *
import time
import datetime

def ScriptProperties():
    return {
        'Author': u'Radim on July 1, 2014',
        'Copyright': u'',
        'Description': u'Save current selection as auto-named PNG with stripped blank borders.',
        'Host': u'PaintShop Pro',
        'Host Version': u'16.00'
        }

# Append zero ('0') before value if is smaller than 10 and return String
def zero(i):
    return (str(i) if i>9 else '0'+str(i))

# Generate file from current Date and Time
def fileName():
    t = time.localtime()
    return str(t.tm_year)+'-'+zero(t.tm_mon)+'-'+zero(t.tm_mday)+'_'+zero(t.tm_hour)+'-'+zero(t.tm_min)+'-'+zero(t.tm_sec)

def Do(Environment):
    # Copy
    App.Do( Environment, 'Copy', {
            'GeneralSettings': {
                'ExecutionMode': App.Constants.ExecutionMode.Default, 
                'AutoActionMode': App.Constants.AutoActionMode.Match, 
                'Version': ((16,0,0),1)
                }
            })

    # PasteGraphicAsNewImage
    App.Do( Environment, 'PasteGraphicAsNewImage', {
            'CreateFromDropData': False, 
            'GeneralSettings': {
                'ExecutionMode': App.Constants.ExecutionMode.Default, 
                'AutoActionMode': App.Constants.AutoActionMode.Match, 
                'Version': ((16,0,0),1)
                }
            })

    # SelectDocument
    App.Do( Environment, 'SelectDocument', {
            'SelectedImage': 0, 
            'Strict': False, 
            'GeneralSettings': {
                'ExecutionMode': App.Constants.ExecutionMode.Default, 
                'AutoActionMode': App.Constants.AutoActionMode.Match, 
                'Version': ((16,0,0),1)
                }
            })

    # Magic Wand
    App.Do( Environment, 'MagicWand', {
            'General': {
                'Mode': App.Constants.SelectionOperation.Replace, 
                'Antialias': False, 
                'Feather': 0, 
                'SampleMerged': False
                }, 
            'MatchMode': App.Constants.MatchMode.Color, 
            'Contiguous': True, 
            'Point': (0,0),
            'Tolerance': 3,
            'AntialiasType': App.Constants.AntialiasType.Outside, 
            'GeneralSettings': {
                'ExecutionMode': App.Constants.ExecutionMode.Default, 
                'AutoActionMode': App.Constants.AutoActionMode.Match, 
                'Version': ((16,0,0),1)
                }
            })

    # SelectInvert
    App.Do( Environment, 'SelectInvert', {
            'GeneralSettings': {
                'ExecutionMode': App.Constants.ExecutionMode.Default, 
                'AutoActionMode': App.Constants.AutoActionMode.Match, 
                'Version': ((16,0,0),1)
                }
            })

    # Crop
    App.Do( Environment, 'Crop', {
            'Mode': App.Constants.CropMode.CropSelection,
            'Units': App.Constants.CropUnits.Inches, 
            'SelectedArea': False, 
            'PrintWidth': -1, 
            'PrintHeight': -1, 
            'CropAsNewImage': False, 
            'RotationAngle': 0, 
            'AutoFit': False, 
            'GeneralSettings': {
                'ExecutionMode': App.Constants.ExecutionMode.Default, 
                'AutoActionMode': App.Constants.AutoActionMode.Match, 
                'Version': ((16,0,0),1)
                }
            })

    # CropFixup
    App.Do( Environment, 'CropFixup', {
            'GeneralSettings': {
                'ExecutionMode': App.Constants.ExecutionMode.Silent, 
                'AutoActionMode': App.Constants.AutoActionMode.Match, 
                'Version': ((16,0,0),1)
                }
            })


    # FileSave
    App.Do( Environment, 'FileSave', {
            'Encoding': {
                'PNG': {
                    'Interlaced': False, 
                    'OptimizedPalette': True, 
                    'AlphaChannel': False
                    }
                }, 
            'FileName': u'S:\\Output\\' + fileName() + '.png',
            'FileFormat': App.Constants.FileFormat.PNG, 
            'WorkingMode': 0, 
            'GeneralSettings': {
                'ExecutionMode': App.Constants.ExecutionMode.Default, 
                'AutoActionMode': App.Constants.AutoActionMode.AllAlways, 
                'Version': ((16,0,0),1)
                }, 
            'DefaultProperties': []
            })

    # FileClose
    App.Do( Environment, 'FileClose', {
            'GeneralSettings': {
                'ExecutionMode': App.Constants.ExecutionMode.Silent, 
                'AutoActionMode': App.Constants.AutoActionMode.Match, 
                'Version': ((16,0,0),1)
                }
            })
Carolrob
Posts: 10
Joined: Wed Mar 07, 2012 9:20 am
operating_system: Vista Home Premium
System_Drive: C
32bit or 64bit: 64 Bit

Re: How do I "detube" an image?

Post by Carolrob »

Thanks to everyone your help.
Radim your script helped greatly.

Carol
Post Reply