Page 8 of 9

Re: PicToPainting with Paint Shop pro 2019

PostPosted: Thu Apr 18, 2019 11:40 am
by Kye Wood
Worked for me too. So glad to find this gem of a fix.

Thank you most kindly :-)

ps: bobbyb posted this other part in this thread (viewtopic.php?f=56&t=64218&start=90#p367336) that solved my UI issue. Two unsolvable problems cured in a single thread! Amazingly amazing folks.

Re: PicToPainting with Paint Shop pro 2019

PostPosted: Thu Apr 18, 2019 11:42 am
by Kye Wood
bobbyb wrote:I have an easier way. It's just 3 modifications to the index.html. See caveat below.


bobbyb - you legend!

This fixed it perfectly. Thank you kindly for taking the time to share that.

Kind Regards,
K.

Re: PicToPainting with Paint Shop pro 2019

PostPosted: Fri Apr 19, 2019 8:21 pm
by bobbyb
I downloaded the plugin a few days ago and it changed a bit but the same idea. There are 5 lines of br to comment out for the fix. You need to make it look like this:

Code: Select all
     <div class="content" >
         <div>Style:</div>
         <div>
            <img id="preview_image" style="width:280px;height:208px;" src="img/012.png" />
      <!--  <br/> -->
            <div style="float: right; ">
                 <button onclick="process_image('preview');" id="preview-button" title="">Preview Style</button>
                 <button  onclick="reset();" id="restore-button" title="">Reset</button>
             </div>
      <!--   <br/> -->
         </div>
    <!-- <br/> -->
     </div>
     <hr>
     <div class="sidebar-title">Step 3: Adjust Strength </div>
     <!--<div style="margin-top: 8px">Strength:</div> -->
     <div class="slidecontainer">
             <input  id="ex1" data-slider-id='ex1Slider' type="text" />
     </div>
<!-- </br> -->
     <hr>
     <!-- Step 4: Adjust Settings-->
     <div class="sidebar-title">Step 4: Confirm Painting </div>
     <div class="content">
         <div style="font-style: italic">Your painting will be sent to your application as a layer. This process may take a few seconds.</div>
    <!-- <br><br><br>  -->
         <button style="float: right; padding: 4px 48px;" onclick="process_image('apply');" id="apply-btn" title="">Send and Close</button>
         <br/>
     </div>
 </div>


Unfortunately, for me, the plugin just makes the spinner turn and probably forever if I let it. So it is of little use

Re: PicToPainting with Paint Shop pro 2019

PostPosted: Sat Apr 20, 2019 12:46 am
by LeviFiction
That spinner is the part that annoys me the most. They clearly know how to properly hand asynchronous coding in JavaScript. Yet when the external app they call fails, they don't handle the failure properly.

It's like an additional five or six lines of code to stop the spinner and let the user exit. More if they want to present the error to the user letting them know to give up.

I may suck at HTML xD but I'm worse with JavaScript and I was able to figure this out.

Re: PicToPainting with Paint Shop pro 2019

PostPosted: Sat Apr 20, 2019 3:22 am
by iraisok
Any fix for
a) not being able to set strength slider before clicking preview,
b) for the slider jumping to max strength when you click preview at which time you set strength slider, and
c) not remaining at the position you set, and
d) that it jumps to max strength when you click save even though it is at your desired strength when viewed at timeline?

To have Pic To Painting work for me (thank you Levi), and knowing that none of what I "wish" for here are show stoppers is good enough. At least Corel could read it all here.

Re: PicToPainting with Paint Shop pro 2019

PostPosted: Sat Apr 20, 2019 6:03 am
by LeviFiction
Ira, give these a try. I think they work. This was a fun chance to brush up on my JavaScript.

As always, make sure to backup the original files before replacing them. Here are the two files in the zip and where they are located

Index.js
C:\Program Files\Pic-To-Painting\resources\app\app\js\index.js

Index.html
C:\Program Files\Pic-To-Painting\resources\app\app\index.html

Re: PicToPainting with Paint Shop pro 2019

PostPosted: Sat Apr 20, 2019 6:47 pm
by LeviFiction
Nevermind. I was wrong. Did the same thing they did, forgot to handle the asynchronous nature of the external programs. :P It will fail multiple times when trying to send back to PSP
it will work eventually. Just takes a few tries. More work to be done.

Re: PicToPainting with Paint Shop pro 2019

PostPosted: Sat Apr 20, 2019 9:00 pm
by iraisok
LeviFiction wrote:Ira, give these a try. I think they work. This was a fun chance to brush up on my JavaScript.

As always, make sure to backup the original files before replacing them. Here are the two files in the zip and where they are located

Index.js
C:\Program Files\Pic-To-Painting\resources\app\app\js\index.js

Index.html
C:\Program Files\Pic-To-Painting\resources\app\app\index.html


Levi,
Your changes work 100%. A fantastic improvement. I had no problem on multiple iterations of Save and Close returning to PicToPaint, etc. I understand and accept that the slider starts at Max strength whenever opening PicToPaint. Afterall, you'd need to save last position and read a file to return to same position. That is not worth doing. The fact that I can move slider to where I think I want to be and change it AFTER clicking Preview and having it change w/o clicking preview and ultimately that it does NOT jump to max strength when I click Save and Close/return to PSP (even though it represented my desired position) ...is a wonderful improvement. THANK YOU SO MUCH. I will compare both files that with originals to see how you accomplished it. Also, I read your followup post. I'm thinking you were expecting a problem. If it was to do with your update, when might I experience the problem form all I tried (seems fine)?

Thank you again,

Re: PicToPainting with Paint Shop pro 2019

PostPosted: Sat Apr 20, 2019 10:03 pm
by LeviFiction
When I originally posted all seemed fine. Then when I tried again today hitting "send and close" would show the spinner then do nothing. There were several errors about expected files not existing. Causing the final send to fail.

It took several tries before the plug-in closed and all worked like it was supposed to. I am unsure of exactly when this will happen but you may experience it and you may not.

I am working on an update that I hope to be much more efficient.

Right now Pic-to-painting creates 260 versions of your image, 20 for each present representing the blend levels. This annoys me. There is no valid reason to slow the program down and create so many cached images. So I am trying to do the blend using CSS and JavaScript. This should speed things up a bit as it only needs to cache 13 images instead of 260.

It should also prevent the bug I dealt with. It will also auto-update the preview of the effect has been cached and auto apply the current blend setting when a preset is clicked on instead of forcing you to hit preview each time you want to see a new effect.

Re: PicToPainting with Paint Shop pro 2019

PostPosted: Sat Apr 20, 2019 10:33 pm
by iraisok
Levi,

I look forward to your next update. But for now please tell me where the ~260 files are created and if they are deleted when returning to PSP?

Much thanks,
Ira

Re: PicToPainting with Paint Shop pro 2019

PostPosted: Sat Apr 20, 2019 10:49 pm
by LeviFiction
Yes they are deleted.

They are in

C:\users\username\appdata\local\temp\pic-to-painting\output\

Re: PicToPainting with Paint Shop pro 2019

PostPosted: Sun Apr 21, 2019 2:02 pm
by LeviFiction
Okay, this one seems to be working better.

If you click on a preset or move the slider and nothing happens, then you need to click the preview button. Otherwise, as it creates the cache it should auto-update the preview as you click around. And applying the result should be error free.

Re: PicToPainting with Paint Shop pro 2019

PostPosted: Sun Apr 21, 2019 7:18 pm
by bobbyb
I gave this a try also. The spinner stops and it exits but nothing happens. I get 2 dumps in my local CrashDumps folder with names I regognise: nnart_generate_cache_cmd.exe.6612.dmp and nnart_preview_cmd.exe.8560.dmp

I also noticed both an input and output folder in the Pic-To-Painting folder. The input had the proper image in it.

Re: PicToPainting with Paint Shop pro 2019

PostPosted: Sun Apr 21, 2019 7:32 pm
by iraisok
LeviFiction wrote:Okay, this one seems to be working better.

If you click on a preset or move the slider and nothing happens, then you need to click the preview button. Otherwise, as it creates the cache it should auto-update the preview as you click around. And applying the result should be error free.


Levi,
This update works properly although this one seems to work same as the 1st. After the 1st click of Preview Style the style changed in when just changing the Strength slider... as before. Of course, I will run with your latest update. Also, for both versions, I observe the "...\Local\Temp\Pic-to-Painting\output\" folder clean up after I click Send and Close and return to PSP Editor. I happen to use ATF Cleaner Ver 3 daily to clean out temp folders. It removes the "...\Local\Temp\Pic-to-Painting\" folder entirely. That's good.

BTW: I was the 1st and 3rd person to d/l the zip. When I d/l'd the 1st time I was on my iPad (in bed) just wanting to test the 'UnZip' app I had just added. I could have easily sent it to my PC as I am on now but just re D/L'd as your 3rd visitor.

EDIT #1: I don't believe the RESET button works with Update #2. I think it would revert to the image when you opened PTP. My preference would be to back out of multiple changes made either by selecting multiple templates or changes to strength. That said, what you have done so far is marvelous. I will try Update #1 to compare actions I've been taking with Update #2 and do another edit below this one. I hope this forum send you e-mails following updates to the same reply as I am doing? Back shortly ....

EDIT #2: I test all three versions. Results follow:
1. Original index.js and index.html files: Must follow the steps 1,2 and 3 shown on PTP GUI. By that I mean can't move slider until you select Paint Style and click Preview Image. If you change Paint Style, you must click Preview Image before Slider will move. Strength changes as you change Slider position. Reset button returns image to as you entered PTP and if you then click Send and Close, the image will look exactly the way it was when you entered PTP. The Output subfolder does clear out when returning to PSP.

2. 1st update to index.js and index.html files: Can move Strength Slider any time but need to click Preview Style afterwards (once) to see changes as you drag slider. When you click Reset, the slider locks up at max. When you next click Send and Close, the image is NOT reset but at the MAX Strength. NG! The Output subfolder is cleared out though.

2. 2st update to index.js and index.html files: Same as 1st update except Reset does NOT work (does nothing).

BTW: I was thinking I can combine Paint Styles during same PTP session but it does not appear to work that way. After click Send and Close then back into PTP you can combine. Of course its best to use separate PSP layers for ultimate control

EDIT #3: Using original files but believe would see same results with Update #1: This is NOT a showstopper just something to avoid. If I press the Reset button in PTP without having made any changes to the image, and then click Send and Close, PTP never returns to PSP Editor. I just see the circle. I must kill the PTP process. Also, and this applies to ALL three file sets - If, for some reason, the output folder does not get cleared, next time I enter PTP, there is no image in the input folder and so no image to work with. I may have prevented the output folder from being cleared by my sitting in it with my file explorer. - Again - this edit to the reply is not critical at all.

Summary: From my observation, running with the original two files has the best result in that all functions work, the Output subfolder is empty when returning to PSP and Reset works. For now I will run with the original two files but am thankful for you to working at improving the user experience. I will look at your code changes comparing all three version for both files. If I see something worth mentioning, I'll get back with you.

Thanks and I'm receptive to try anything you think up,
Ira

Re: PicToPainting with Paint Shop pro 2019

PostPosted: Sun Apr 21, 2019 9:32 pm
by LeviFiction
@bobbyb - did you try downloading the replacing the Tensorflow folder? Yes it's not recommended by Corel, but it won't hurt anything. It'll just fail to load if it won't work.

Tensorflow 1.5 -
https://drive.google.com/open?id=1b4yV3 ... r0tK2PijkB

Go to C:\Program Files\Pic-to-Painting\resources\app\app\nnart\lib

Rename the tensorflow folder to tensorflow.old as a backup. Then copy the tensorflow 1.5 folder into this location. Then try running the plugin.

@iraisok -

You're correct, reset does nothing. As it's always technically done nothing. Very specifically reset did two things 1) It set the slider to 100%. 2) It set the visible image back to default. It never deleted any cached files. So when you hit "Preview" again it would just use whatever cached image was already there.

Because I changed how the underlying code works, and added the nnart cache file on top of the original file, technically the closest thing to a "Reset" would be to set the slider to zero. It would be effectively the exact same thing. I'll reset that, but first I need to deal with an issue getting all of the files to match up at the very end. Still not handling that correctly.

Then I'll activate the ability for the plugin to be used as a stand-alone program. All of the elements are there, they just aren't activated.