Do we have anything close to Ps StockSolo and Icons8?

Corel Paint Shop Pro

Moderator: Kathy_9

migf1
Posts: 485
Joined: Fri Apr 03, 2020 3:09 pm
operating_system: Windows 8.1
System_Drive: C
32bit or 64bit: 64 Bit

Do we have anything close to Ps StockSolo and Icons8?

Post by migf1 »

StockSolo: https://stocksolo.com/?ref=producthunt
Icons8: https://icons8.com/app/photoshop

Those are both free for PS. They are advertised as plugins, but they are actually Ps Extensions (aka Javascript).

StockSolo opens a panel inside PS where one can search on sites like Unsplash, Pixabay, Pexels, Adobe Stock and the likes, with the results being displayed in that panel, and they can be dragged directly into the canvas. Icons8 does something similar but for icons.

So do we have anything similar for PSP? Especially something close to StockSolo would be plain awesome. If not, is something like that possible via PSP scripting?
Good Unofficial PaintShop Pro Tutorials: Creation CasselMake Shop ProHEC Image EditingLeviFiction PSP Basics
(plus my own Gimp & Stuff)
LeviFiction
Advisor
Posts: 5985
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, 9, X, XI, X2, X8,X9, 2018, 2019
Location: USA

Re: Do we have anything close to Ps StockSolo and Icons8?

Post by LeviFiction »

Corel would have to build this integration on their own.

There is no ability for us to add our own panels.

Scripts have access to TKinter GUI tools but they don't have a built in HTML web widget.

There are other possible workarounds using separate programs but no idea if one could reasonably be made to be better than than just opening a web browser and accessing these things directly.
LeviFiction
Advisor
Posts: 5985
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, 9, X, XI, X2, X8,X9, 2018, 2019
Location: USA

Re: Do we have anything close to Ps StockSolo and Icons8?

Post by LeviFiction »

Gonna preface this with: I still haven't played with the plugin, and I've only done a very cursory look at the documentation for the APIs of each website that StockSolo uses. I have a possible idea, but I would need to see this plugin in action to know how it works. I'll probably look on Youtube.

I'm also uncertain how best to implement it.

My idea is we can create an Electron app (uses Javascript and HTML - PSP used it for their Pic-To-Painting plugin) to create a viewer using the APIs from Unsplash, Pexels, and Pixabay (not Adobe Stock because I'm mad at them right now). We use a script to run this App then go into a loop waiting for signals from the App. When a user selects an image or resource they want to "send to PSP" they'll press an appropriately named button, the app will download the file to a temporary folder, and then the script seeing this change will import the resource into PSP automatically.

Just need someone who knows how to program in NodeJs and compile Electron apps. A simple PSP Python script to run an application and import data is easy. I technically did it when I was playing around with the idea of a script manager program that would download and install scripts automatically. Never made more than the base proof of concept but it is doable.
migf1
Posts: 485
Joined: Fri Apr 03, 2020 3:09 pm
operating_system: Windows 8.1
System_Drive: C
32bit or 64bit: 64 Bit

Re: Do we have anything close to Ps StockSolo and Icons8?

Post by migf1 »

Hi Levi,

thanks for taking interest in this. I really have no clue about JS programming (though I know what NodeJS is) and I've also no clue about Electron apps in general (lol). However, I did some googling and came across this: https://stackoverflow.com/questions/524 ... ter-window

The 2nd answer is from the developer of a tkinter widget called: tkinterweb, but again I have no idea if that's something that could help in this case. Finally, the 1st answer suggests using Django or Flask instead (which are python "counterparts" of NodeJS) though I don't think if one should go through learning a whole new framework, just for this task.

I just got an idea too, but I'll do some research and come back.

I'm thinking of a PSP script asking for the search string, then calling the default browser (or any specified browser) passing it the search key along with the photo hosting service as command line arguments. The photo hosting service could also be user selected via the script (probably in a dialog with radio or toggle buttons). I don't know if web browsers are capable of taking multiple urls along with ?" parameters as command line arguments -it would be great if they do, since if the user chooses to the dialog could pass the search key to all selected services at once, and then most likely having the search results into different browser-tabs for different services.

This sounds much simpler to me, right? At least it will automate the process of going manually to the browser, then go to the site of the photo service, and type in the search key in there.

We'll still have to go the browser, but the results will be already displayed in their own tab. From there, I personally don't mind clicking on the desired photo to zoom it in, then right-click -> Copy Image manually, then switch back to PSP and Copy as New Image or Copy As New Layer. Fully automated would be great, but it sounds a heck lot of work to me.

Let me know what you think.
Last edited by migf1 on Fri Mar 19, 2021 1:27 pm, edited 5 times in total.
Good Unofficial PaintShop Pro Tutorials: Creation CasselMake Shop ProHEC Image EditingLeviFiction PSP Basics
(plus my own Gimp & Stuff)
migf1
Posts: 485
Joined: Fri Apr 03, 2020 3:09 pm
operating_system: Windows 8.1
System_Drive: C
32bit or 64bit: 64 Bit

Re: Do we have anything close to Ps StockSolo and Icons8?

Post by migf1 »

LeviFiction wrote:
Fri Mar 19, 2021 12:21 am
...
My idea is we can create an Electron app (uses Javascript and HTML - PSP used it for their Pic-To-Painting plugin) to create a viewer using the APIs from Unsplash, Pexels, and Pixabay (not Adobe Stock because I'm mad at them right now).
...
I'm dying to hear why (big LOL).
Btw, I'm also mad at Adobe in general (and at Goggle too for that matter, and at Corel, and.... and... nvm haha).

Nevertheless, here's StockSolo in action: https://youtu.be/VQKH1Xn9WkE
And Icons8: https://youtu.be/G0O4TcQIXPM
Good Unofficial PaintShop Pro Tutorials: Creation CasselMake Shop ProHEC Image EditingLeviFiction PSP Basics
(plus my own Gimp & Stuff)
SMACarthur
Posts: 2
Joined: Fri Mar 19, 2021 12:16 pm
operating_system: Windows 10
System_Drive: C
32bit or 64bit: 64 Bit
motherboard: B360M-a
processor: i5 9400F
ram: 16GB
Video Card: 2060s
Hard_Drive_Capacity: 500GB
Monitor/Display Make & Model: Samsung 27`
Corel programs: Corel Draw

Re: Do we have anything close to Ps StockSolo and Icons8?

Post by SMACarthur »

I use Icons8, but i want to try StockSolo too
migf1
Posts: 485
Joined: Fri Apr 03, 2020 3:09 pm
operating_system: Windows 8.1
System_Drive: C
32bit or 64bit: 64 Bit

Re: Do we have anything close to Ps StockSolo and Icons8?

Post by migf1 »

Okay, I think I did it for Unsplash.com. Seems to work fine.

However, I was unable to find a way of using radio or check buttons in a dialog in the PSP scripting API, so I guess I'll have to make separate scripts for each photo service.

I had a look at cosmicDread's excellent LMDT script, but it seems he's made custom Tk widgets and that's beyond me for now. So unless someone steps in adding a single dialog with radio or check buttons for all services, I'll do separate scripts for each service and I'll probably bind them all into a custom menu.

I'm attaching below the one I just did for Unsplah (both for d/l and in code tags) and when I have pexels and pixabay ready (or we have them all as options in a single script), I'll post them all in the PSP Scripting forum.

I flagged it as PSP X7 but it should work fine in earlier versions too.
But it needs to be placed inside the Trusted Scripts folder (because it opens the default web-browser).

Code: Select all

from PSPApp import *
import webbrowser

def ScriptProperties():
    return {
        'Author': u'',
        'Copyright': u'',
        'Description': u'',
        'Host': u'PaintShop Pro',
        'Host Version': u'17.00'
        }

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

    # Repeat until user cancels or specifies a search key
    while True:
        # GetString prompts the user to enter text.  The return
        # is a dictionary.
        # Result[ 'OKButton' ] is true if the OK button was pressed, false if Cancel was pressed
        # Result[ 'EnteredText' ] is the string they entered
        # in silent mode it will always just return the default text without displaying a dialog
        # in interactive mode it will display the dialog normally
        defText = "type in your search word(s) here"
        Result = App.Do( Environment, 'GetString', {
            'DefaultText': defText,
            'DialogTitle': 'Powered by Unsplash.com',
            'Prompt': 'Enter one or more search words below, separated by blanks. Results will appear in your web browser.',
            'MaxLength': 200,
            'GeneralSettings': {
                'ExecutionMode': App.Constants.ExecutionMode.Interactive
                }
            })
        # print 'Button pressed = %d' % Result[ 'OKButton' ]
        # print 'Text = %s' % Result[ 'EnteredText' ]

        # user hits Cancel? Do nothing & Exit
        if not Result[ 'OKButton' ]:    
            break

        # user hits OK? if valid search-key entered then proceed, else repeat until we get valid search-key 
        searchKey = Result[ 'EnteredText' ]
        if searchKey and searchKey != defText:			# search-key validation
            searchKey = "-".join( searchKey.split() )   # replace blanks with '-'
            serviceUrl = "https://unsplash.com/s/photos/" + searchKey
            webbrowser.open(serviceUrl, new=2)
            break

        App.Do(Environment,  'MsgBox', {
                'Buttons': App.Constants.MsgButtons.OK, 
                'Icon': App.Constants.MsgIcons.Info, 
                'Text': 'Please specify search word(s) in the previous dialog, or Cancel it.', 
                })
D/L:
migf1 StockUnsplash (trusted).zip
(1.16 KiB) Downloaded 17 times
Good Unofficial PaintShop Pro Tutorials: Creation CasselMake Shop ProHEC Image EditingLeviFiction PSP Basics
(plus my own Gimp & Stuff)
LeviFiction
Advisor
Posts: 5985
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, 9, X, XI, X2, X8,X9, 2018, 2019
Location: USA

Re: Do we have anything close to Ps StockSolo and Icons8?

Post by LeviFiction »

migf1 wrote:
Fri Mar 19, 2021 10:36 am
I'm dying to hear why (big LOL).
Btw, I'm also mad at Adobe in general (and at Goggle too for that matter, and at Corel, and.... and... nvm haha).

Nevertheless, here's StockSolo in action: https://youtu.be/VQKH1Xn9WkE
And Icons8: https://youtu.be/G0O4TcQIXPM
My reason for wanting to try this way is because of control and automation. Technically I could make the stock requesting app in almost any language so long as it was external to PSP because of the limitations introduced by PSP into their internal version of Python. Electron takes away a lot of the design elements by using HTML to handle most of it using a chromium browser. And NodeJS has a lot of libraries to help with management.

By mixing a PSP script with another app we can control the whole process from finding to loading the results. Filtering out file types PSP doesn't properly support, and auto-adding masks to layers for clipping mask style adding.

I have a basic example that I will clean up tonight and make a demo.

I saw the tkinterweb widget and the forked one that makes it more useful. But I am uncertain it would work. PSP uses a custom version of Python and most external libraries don't work, only the default ones or ones written in pure Python do. So even Django or Flask may not work inside PSP. Even if they do they are just web server frameworks and still require an external web browser.

Where PSP is concerned if it's not a built in library I don't want to rely on it.
LeviFiction
Advisor
Posts: 5985
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, 9, X, XI, X2, X8,X9, 2018, 2019
Location: USA

Re: Do we have anything close to Ps StockSolo and Icons8?

Post by LeviFiction »

This is just the very beginnings of what I was imagining in my head. I still need to work out how the PSP script and the Electorn App will talk to each other. Maybe I'll turn the PSP app into a server and let the Electron app send REST requests to it. No idea. So it's not really functional beyond making it run via PSP script, and how pretty the images look.

https://drive.google.com/file/d/1zigB0c ... sp=sharing
migf1
Posts: 485
Joined: Fri Apr 03, 2020 3:09 pm
operating_system: Windows 8.1
System_Drive: C
32bit or 64bit: 64 Bit

Re: Do we have anything close to Ps StockSolo and Icons8?

Post by migf1 »

This is amazing Levi! You should definitely finish it up! Can't wait!

I made mine working with several services, but they are defined by editing the script, so I started reading the Tkinter API and trying to add a custom dialog. This is what I have so far: http://prntscr.com/10qj20w but is not functioning yet (and I'm dead tired too).

The one that works, does it dynamically adopting to the lines of the dictionary, but requires manually changing the 'Use' keys to True or False in an editor (see below). I'll probably post it if I don't manage to properly code the Tkinter dialog.

Code: Select all

g_services = {
    'unsplash': {'Use': True, 'Name': 'Unsplash', 'Url': 'https://unsplash.com/s/photos/', 'Separator': '-'},
    'pixabay': {'Use': True, 'Name': 'Pixabay', 'Url': 'https://pixabay.com/images/search/', 'Separator': ' '},
    'pexels': {'Use': True, 'Name': 'Pexels', 'Url': 'https://www.pexels.com/search/', 'Separator': ' '},
    'flickr': {'Use': False, 'Name': 'Flickr', 'Url': 'https://www.flickr.com/search/?text=', 'Separator': ' '},
}
PS. I'll scratch mine as soon as yours is ready (I'm mostly trying to educate myself with Tkinter and PSP).
Good Unofficial PaintShop Pro Tutorials: Creation CasselMake Shop ProHEC Image EditingLeviFiction PSP Basics
(plus my own Gimp & Stuff)
Kathy_9
Site Admin
Posts: 2453
Joined: Tue Nov 30, 2010 12:44 am
operating_system: Windows 10
System_Drive: C
32bit or 64bit: 64 Bit
processor: 8th Generation Intel Core i7 8700 3 20 GHz
ram: 16GB
Video Card: NVIDIA GeForce RTX 2060 [6 GB GDDR6 dedicated]
sound_card: NVIDIA High Definition Audio
Hard_Drive_Capacity: 2TB
Monitor/Display Make & Model: HP EliteDisplay E243m 23.8-inch
Corel programs: PSPX4 ~2021; Painter 2018~21
Location: USA
Contact:

Re: Do we have anything close to Ps StockSolo and Icons8?

Post by Kathy_9 »

That looks very slick Levi. Can't wait to see how this progresses.
PSPX ver. 10.10, PSPX9 ver. 19.0.0.96, PSP2021 ver. 23.1.0.27, PSP2020 ver. 22.2.0.8 2019 ver. 21.1.0.22, and & PhotoMirage installed; PSPX2 thru PSP2018 owned but not installed
http://www.flickr.com/photos/37153430@N03/
migf1
Posts: 485
Joined: Fri Apr 03, 2020 3:09 pm
operating_system: Windows 8.1
System_Drive: C
32bit or 64bit: 64 Bit

Re: Do we have anything close to Ps StockSolo and Icons8?

Post by migf1 »

SMACarthur wrote:
Fri Mar 19, 2021 12:19 pm
I use Icons8, but i want to try StockSolo too
Yeap, It makes life a little easier.
Good Unofficial PaintShop Pro Tutorials: Creation CasselMake Shop ProHEC Image EditingLeviFiction PSP Basics
(plus my own Gimp & Stuff)
migf1
Posts: 485
Joined: Fri Apr 03, 2020 3:09 pm
operating_system: Windows 8.1
System_Drive: C
32bit or 64bit: 64 Bit

Re: Do we have anything close to Ps StockSolo and Icons8?

Post by migf1 »

Until Levi finishes LeviStock, I implemented my idea and posted it in the scripts forum: https://forum.corel.com/viewtopic.php?f ... 34#p386534
Good Unofficial PaintShop Pro Tutorials: Creation CasselMake Shop ProHEC Image EditingLeviFiction PSP Basics
(plus my own Gimp & Stuff)
LeviFiction
Advisor
Posts: 5985
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, 9, X, XI, X2, X8,X9, 2018, 2019
Location: USA

Re: Do we have anything close to Ps StockSolo and Icons8?

Post by LeviFiction »

Yeah that's not gonna be for a while. What you saw in the demo was purely HTML and CSS all stolen from examples online. The only javascript was getting the images preview locations from Pixabay. There is still a ton of work to do to make it actually useful.
migf1
Posts: 485
Joined: Fri Apr 03, 2020 3:09 pm
operating_system: Windows 8.1
System_Drive: C
32bit or 64bit: 64 Bit

Re: Do we have anything close to Ps StockSolo and Icons8?

Post by migf1 »

LeviFiction wrote:
Tue Mar 23, 2021 4:10 pm
Yeah that's not gonna be for a while. What you saw in the demo was purely HTML and CSS all stolen from examples online. The only javascript was getting the images preview locations from Pixabay. There is still a ton of work to do to make it actually useful.
Levi I just updated mine in the scripting forum, but I'm mostly playing around with Tkinter to get the hang of it (along with the crippled python version we have for Psp scripting).

I did various tests and I actually managed to download and save an image from unsplash, with the urllib.urlretrieve() function. I've left the code commented out in the script.

I have no idea if the urllib (or urllib2) are suitable for "talking" with the photo-hosting sites API's. Also I didn't find any way of displaying images inside a Tkinter window, since Corel seems to have left out any imaging library module (i tried PIL, PIllow, openCV.... none of those were imported). Btw, if we downlaod PIL for example, can we somehow install it in PSP's python libraries folder?
[snip]
I still need to work out how the PSP script and the Electorn App will talk to each other
I still have no clue what Electron is (haven't even googled it yet) but if your demo can already fetch the url of a dispalyed image (the "Send to PSP" button I saw you had there) couldn't you just download the image, temporarily save it on the hard-disk, and then calling PSP passing it the saved file as a command line argument? In my tests, when PSP is already open it just opens the image (else it runs and then opens the image in it)
Good Unofficial PaintShop Pro Tutorials: Creation CasselMake Shop ProHEC Image EditingLeviFiction PSP Basics
(plus my own Gimp & Stuff)
Post Reply