Kodi Community Forum
colorbox - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32)
+--- Forum: Skinning (https://forum.kodi.tv/forumdisplay.php?fid=12)
+---- Forum: Skin helper addons (https://forum.kodi.tv/forumdisplay.php?fid=300)
+---- Thread: colorbox (/showthread.php?tid=303846)

Pages: 1 2 3 4 5


colorbox - smitchell6879 - 2017-01-11

So new question how does the blur effect work with color box... Can it show fanart blurred on the fly as soon as the item is highlighted?


RE: colorbox... image blur - badaas - 2017-01-12

Yes, If using github version check skin.APEx or skin.mimix (on github @ https://github.com/BADMS/skin.mimix)
Or readme on github if using repo version.


RE: colorbox... image blur - smitchell6879 - 2017-01-12

I read through it a time or two... I have the code in the startup.xml to create the cache folder... And this is the noob in me but how would I actually code it to run the script..... I have a control list and I want the fanart that is in the background to be blurred as I go thru the dynamic list... Is the fast enough not to cause a issue blurring a lot of images? And mostly how would I use the window property to see the out put image.

I know I a. Asking a lot... The window property I just haven't got to work yet... I guess I can't figure out the correct way to use it.

Thanks for any advice


RE: colorbox... image blur - badaas - 2017-01-12

Ok, which version of cbox? Installed via kodi or from github? (The github version is easier to use, but obviously not in repo yet).


If it is running below should work, check /kodi/userdata/addon_data/script.colorbox/ for processed images.
It will cache them for faster access.
It will process current 'ListItem.Art(fanart)'.

Code:
            <control type="image">
                <aspectratio align="center">scale</aspectratio>
                <texture background="true">$INFO[Window(home).Property(ImageFiltercfa)]</texture>
            </control>

Or you can use a button, ie. onfocus in focused item to send a request to process whatever you like. (Or use <onload> etc, anything that can fire a command).
But this won't always get caught quick enough so best used for 'occasional' art, ie. video info background, etc.

Code:
            <onfocus>RunScript(script.colorbox,info=pixelate,id='"'$INFO[ListItem.Art(thumb)]"',pixels=10_SIZE,prefix=My_pixelled_thumb)</onfocus>

You will then have use as '$INFO[Window(home).Property(My_pixelled_thumb.Image)]'.


RE: colorbox... image blur - smitchell6879 - 2017-01-12

Alright cool so I was using it somewhat right... I will have to try with a static background I am guess as your say on the onfocus is what I was using. My PC must just be to slow to process it on the fly. Thanks for your help.


RE: colorbox... image blur - badaas - 2017-01-12

read the readme @ https://github.com/BADMS/script.colorbox/blob/master/Readme.md

Forgot you need to tell daemon what effect!

So for example in startup.xml

Code:
    <onload>SetProperty(cfa_daemon_set,blur,home)</onload>

It will take time to process image first of all, then is instant once cached.


RE: colorbox... image blur - smitchell6879 - 2017-01-12

Alright I will try once again

My startup will be set cache. And set property...
Then my window is 5000. So I put <onload>RunScript(script.colorbox,info=bluronly,id='"'$INFO[Container(9001).ListItem.Art(fanart)]"', radius=10,prefix=BlurFanart)</onload>

Then I can use $INFO[Window.(home). Property (BlurFanart.Image)]. To get the image to show?


RE: colorbox... image blur - badaas - 2017-01-12

Yes.
It should also process current windows ListItem.Art(fanart) auto if daemon is set up.


RE: colorbox... image blur - smitchell6879 - 2017-01-12

Cool will try again it will be later tonight.. thank you for the help


RE: colorbox... image blur - badaas - 2017-01-12

Check skin.eunique for jarvis, uses colorbox a lot

https://github.com/im85288/skin.eunique


RE: colorbox... image blur - smitchell6879 - 2017-01-18

This is what I get when running colorbox. not sure where I am screwing up.

Code:
20:39:37.266 T:14380   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <type 'exceptions.ValueError'>
                                            Error Contents: invalid literal for int() with base 10: '10_SIZE'
                                            Traceback (most recent call last):
                                              File "H:\Kodi_17_RC3\Kodi\portable_data\addons\script.colorbox\default.py", line 411, in <module>
                                                ColorBoxMain()
                                              File "H:\Kodi_17_RC3\Kodi\portable_data\addons\script.colorbox\default.py", line 26, in __init__
                                                self._parse_argv()
                                              File "H:\Kodi_17_RC3\Kodi\portable_data\addons\script.colorbox\default.py", line 376, in _parse_argv
                                                self.pixels = int(arg[7:])
                                            ValueError: invalid literal for int() with base 10: '10_SIZE'
                                            -->End of Python script error report<--
20:40:01.465 T:2532   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <type 'exceptions.UnboundLocalError'>
                                            Error Contents: local variable 'imagecolor' referenced before assignment
                                            Traceback (most recent call last):
                                              File "H:\Kodi_17_RC3\Kodi\portable_data\addons\script.colorbox\default.py", line 411, in <module>
                                                ColorBoxMain()
                                              File "H:\Kodi_17_RC3\Kodi\portable_data\addons\script.colorbox\default.py", line 31, in __init__
                                                self._StartInfoActions()
                                              File "H:\Kodi_17_RC3\Kodi\portable_data\addons\script.colorbox\default.py", line 295, in _StartInfoActions
                                                HOME.setProperty(self.prefix + "ImageCColor", Complementary_Color(imagecolor))
                                            UnboundLocalError: local variable 'imagecolor' referenced before assignment
                                            -->End of Python script error report<--
20:42:10.238 T:13472   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <type 'exceptions.ValueError'>
                                            Error Contents: invalid literal for int() with base 16: ''
                                            Traceback (most recent call last):
                                              File "H:\Kodi_17_RC3\Kodi\portable_data\addons\script.colorbox\default.py", line 411, in <module>
                                                ColorBoxMain()
                                              File "H:\Kodi_17_RC3\Kodi\portable_data\addons\script.colorbox\default.py", line 31, in __init__
                                                self._StartInfoActions()
                                              File "H:\Kodi_17_RC3\Kodi\portable_data\addons\script.colorbox\default.py", line 291, in _StartInfoActions
                                                HOME.setProperty(self.prefix + "ImageCColor", Complementary_Color(imagecolor))
                                              File "H:\Kodi_17_RC3\Kodi\portable_data\addons\script.colorbox\resources\lib\Utils.py", line 44, in Complementary_Color
                                                comp = ['%02X' % (255 - int(a, 16)) for a in rgb]
                                            ValueError: invalid literal for int() with base 16: ''
                                            -->End of Python script error report<--[/code]



RE: colorbox... image blur - badaas - 2017-01-18

Pass '10' not '10_SIZE'.

The other error I'll check when home.
Which version of colorbox, github or repo?


RE: colorbox... image blur - badaas - 2017-01-18

Pixelate error fixed, the other error is yours Big Grin


RE: colorbox... image blur - smitchell6879 - 2017-01-19

Alright I will try again later for now I made a new overlay that I really like and everything is running so smoothly ATM..But will try it again at some point .


RE: colorbox... image blur - smitchell6879 - 2017-01-19

So it works it is writing the image to the user data folder but I am having my normal window home property issue where I am using it wrong or aiming becuase I can not get the image to show as the background..

I have exactly what you have for the image control example I added width and height.... O deamen doesn't work for me I am using RunScript on load of window... Which works no errors log says susseful I just can't get the $info of the window property to work.

Sorry for the annoyance....