It is currently Fri Mar 29, 2024 9:44 am


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 129 posts ]  Go to page 1, 2, 3, 4, 5 ... 7  Next
Author Message
 Post subject: A GIFT FOR OMG
PostPosted: Thu Dec 31, 2015 6:03 am  (#1) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14804
Location: roma, italy
A New Year is coming very soon in Australia.
OMG is preparing sweets and sparkling wine.
I've prepared for him a special gift.
He is a big fan of crystals, hence I decided to write a script on crystallizing an image.
No special creations as OMG is used to do, only a trasformation of an input image.
This is the flow of the filter:

....................................................................................................................

Release 1.0 initial


Flow implemented to get the final result: ...detail the major steps

1. set-up context values
2. add alpha to the drawable is not present
3. resize the input image to a fixed size
4. smooth it using G'MIC anisotropic filter and...
...adjust luminosity-contrast-saturation (use of my LCS filter, required if option used)
5. create a new layer
6. transform the image from RGBA to Indexed, with the requested number of colours
7. back to RGBA
8. add a new layer and apply the G'MIC polygonize (delaunay) filter, erode and invert
9. transform back the image from RGBA to Indexed
10.create a temporary palette
11.back to RGBA (re-apply alpha if needed)
12.load all the referenced e-maps
13.for each different color area, apply BRL with an appropriate emap
14.add a new layer, and apply the edge filter to get contours, dilate them
15.bring on top the original layer, grain-merge
16.create a new layer from visible, increase saturation
17.duplicate and invert, overlay
18.delete the temporary palette
19.rescale to original size
20.flatten the image if requested

----------------------------------------------------------------------------------

The filter needs:
- a set of e-maps, here provided (put each folder unzipped under ...(user)/.gimp-2.8)
- the BRL filter (everybody has it after so many uses....)
- my service filter (it may also be used standalone) Mod_LCS, only if the option is selected

Once unziped/loaded (it is in python, thus is a "plug-in" and should be inserted among those)
the filter appears under Diego/Quantize
(the service filter appears under Diego/Colours; it is also in python)

Both filters have been tested by my dear friend Issabella (thanks a lot!), so hopefully they
do not have evident mistakes (maybe they have some hidden ones...).

If you do not have a performant PC, use few colours (8-20), because BRL is applied
once for each colour area, and may take a while.

I hope OMG (and everybody else who wants to use it) will enjoy the gift.

other attachments follow...

PLEASE: FOR THE MAIN FILTER SEE POST #13
(the original attachment has been removed, sorry for the inconvenience)

_________________
"Where am I ?"


Last edited by dinasset on Thu Dec 31, 2015 8:30 am, edited 1 time in total.

Share on Facebook Share on Twitter Share on Orkut Share on Digg Share on MySpace Share on Delicious Share on Technorati
Top
 Post subject: Re: A GIFT FOR OMG
PostPosted: Thu Dec 31, 2015 6:05 am  (#2) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14804
Location: roma, italy
(other attachments)

Attachment:
DIEGO_COLOURS_Mod_LCS.7z [3.09 KiB]
Downloaded 202 times

Attachment:
EMapsGemBLUE.7z [1.35 MiB]
Downloaded 241 times

Attachment:
EMapsGemCYAN.7z [490 KiB]
Downloaded 246 times

_________________
"Where am I ?"


Top
 Post subject: Re: A GIFT FOR OMG
PostPosted: Thu Dec 31, 2015 6:08 am  (#3) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14804
Location: roma, italy
(other attachments)
Attachment:
EMapsGemGRAY.7z [3.19 MiB]
Downloaded 234 times

Attachment:
EMapsGemGREEN.7z [799.71 KiB]
Downloaded 240 times

Attachment:
EMapsGemMAGENTA.7z [620.43 KiB]
Downloaded 202 times

_________________
"Where am I ?"


Top
 Post subject: Re: A GIFT FOR OMG
PostPosted: Thu Dec 31, 2015 6:11 am  (#4) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14804
Location: roma, italy
(other attachments)
Attachment:
EMapsGemRED.7z [1.51 MiB]
Downloaded 212 times

Attachment:
EMapsGemYELLOW.7z [1.43 MiB]
Downloaded 251 times


an example using 8 colours
Attachment:
DSCF0731-cristals.JPG
DSCF0731-cristals.JPG [ 816.93 KiB | Viewed 4776 times ]

_________________
"Where am I ?"


Top
 Post subject: Re: A GIFT FOR OMG
PostPosted: Thu Dec 31, 2015 6:36 am  (#5) 
Offline
GimpChat Member
User avatar

Joined: Mar 01, 2014
Posts: 12579
Location: Spain, Aragón
Thank you so much Dinasset, for me it has been a real pleasure and joyful to test your new "Crystallizing an image"
Let me input in your thread some samples.
Thanks a lot. :jumpclap :bump


Attachments:
misnietos-24colours.jpg
misnietos-24colours.jpg [ 529.38 KiB | Viewed 4767 times ]
swan-20colours.jpg
swan-20colours.jpg [ 1.43 MiB | Viewed 4767 times ]
pink-flower-36colours.jpg
pink-flower-36colours.jpg [ 221.04 KiB | Viewed 4767 times ]

_________________
Image

Gimp 2.10.30(samj) portable _ OS Windows 10 Home_ 64bits
Don’t be afraid to start over. It’s a new chance to rebuild what you want.
Top
 Post subject: Re: A GIFT FOR OMG
PostPosted: Thu Dec 31, 2015 6:39 am  (#6) 
Offline
GimpChat Member
User avatar

Joined: Mar 01, 2014
Posts: 12579
Location: Spain, Aragón
a few more. :)


Attachments:
lovely-lady-24colours.jpg
lovely-lady-24colours.jpg [ 1.18 MiB | Viewed 4766 times ]
jarrones-sombrero-256colours.jpg
jarrones-sombrero-256colours.jpg [ 498.67 KiB | Viewed 4766 times ]
orange_24colours.jpg
orange_24colours.jpg [ 332.6 KiB | Viewed 4766 times ]

_________________
Image

Gimp 2.10.30(samj) portable _ OS Windows 10 Home_ 64bits
Don’t be afraid to start over. It’s a new chance to rebuild what you want.
Top
 Post subject: Re: A GIFT FOR OMG
PostPosted: Thu Dec 31, 2015 7:39 am  (#7) 
Offline
Script Coder
User avatar

Joined: Apr 23, 2010
Posts: 1553
Location: not from Guildford after all
Who is OMG?

_________________
Any sufficiently primitive technology is indistinguishable from a rock.


Top
 Post subject: Re: A GIFT FOR OMG
PostPosted: Thu Dec 31, 2015 7:43 am  (#8) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14804
Location: roma, italy
our companion OldManGrumpy

_________________
"Where am I ?"


Top
 Post subject: Re: A GIFT FOR OMG
PostPosted: Thu Dec 31, 2015 7:59 am  (#9) 
Offline
GimpChat Member
User avatar

Joined: May 16, 2010
Posts: 14709
Location: USA
Thank you dinasset. :)

This is the error i get.
Traceback (most recent call last):
  File "C:\Program Files\GIMP 2\32\lib\gimp\2.0\python\gimpfu.py", line 699, in response
    dialog.res = run_script(params)
  File "C:\Program Files\GIMP 2\32\lib\gimp\2.0\python\gimpfu.py", line 361, in run_script
    return apply(function, params)
  File "C:\Users\Rod\.gimp-2.8\plug-ins\DIEGO_QUANTIZE_Crystallize.py", line 207, in crystallize
    pdb.script_fu_auto_LCS_enhance(inImage, smooth_layer, 0, 0, 144, 80, 160)
error: procedure not found


The plug-in opens fine but crashes
Image

I placed the LSC python script in the plug-ins folder with the Quantize script. Am i missing a script-fu (SCM) file?

EDIT: Works fine after selecting "NO" for stretch colors. :)
Image

_________________
Image
Edmund Burke nailed it when he said, "The only thing necessary for the triumph of evil is for good men to do nothing."


Top
 Post subject: Re: A GIFT FOR OMG
PostPosted: Thu Dec 31, 2015 8:04 am  (#10) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14804
Location: roma, italy
sorry
for the moment set False to Stretch Colours, to test the filter.
I was calling the (previous) version in scheme instead of the new one in python.
I will provide the correction soon.
thanks Rod

_________________
"Where am I ?"


Top
 Post subject: Re: A GIFT FOR OMG
PostPosted: Thu Dec 31, 2015 8:20 am  (#11) 
Offline
GimpChat Member
User avatar

Joined: May 16, 2010
Posts: 14709
Location: USA
dinasset wrote:
sorry
for the moment set False to Stretch Colours, to test the filter.
I was calling the (previous) version in scheme instead of the new one in python.
I will provide the correction soon.
thanks Rod

Okay thanks! Its a fine filter. :bigthup

_________________
Image
Edmund Burke nailed it when he said, "The only thing necessary for the triumph of evil is for good men to do nothing."


Top
 Post subject: Re: A GIFT FOR OMG
PostPosted: Thu Dec 31, 2015 8:22 am  (#12) 
Offline
GimpChat Member
User avatar

Joined: Mar 01, 2014
Posts: 12579
Location: Spain, Aragón
While I did another samples. I love the results. :)


Attachments:
Face_20colours.jpg
Face_20colours.jpg [ 1.42 MiB | Viewed 1028 times ]
Ladies-24colours.jpg
Ladies-24colours.jpg [ 203.33 KiB | Viewed 1028 times ]
portrait-12colours.jpg
portrait-12colours.jpg [ 1.32 MiB | Viewed 1028 times ]

_________________
Image

Gimp 2.10.30(samj) portable _ OS Windows 10 Home_ 64bits
Don’t be afraid to start over. It’s a new chance to rebuild what you want.
Top
 Post subject: Re: A GIFT FOR OMG
PostPosted: Thu Dec 31, 2015 8:25 am  (#13) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14804
Location: roma, italy
I attach here the amended version which calls the new version of ModLCS in python.
Sorry for the inconvenience.
Thanks Rod for discovering it!

Attachment:
DIEGO_QUANTIZE_Crystallize.7z [5.71 KiB]
Downloaded 106 times

_________________
"Where am I ?"


Top
 Post subject: Re: A GIFT FOR OMG
PostPosted: Thu Dec 31, 2015 8:28 am  (#14) 
Offline
GimpChat Member
User avatar

Joined: Sep 24, 2010
Posts: 12513
Will try later Dinasset (don't have time right now). You already know, I like crystals too. lol

:)

_________________
Lyle

Psalm 109:8

Image


Top
 Post subject: Re: A GIFT FOR OMG
PostPosted: Thu Dec 31, 2015 8:34 am  (#15) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14804
Location: roma, italy
OK Lyle, thanks for your interest (yes, I know, you too like Crystals!)

_________________
"Where am I ?"


Top
 Post subject: Re: A GIFT FOR OMG
PostPosted: Thu Dec 31, 2015 8:42 am  (#16) 
Offline
GimpChat Member
User avatar

Joined: May 16, 2010
Posts: 14709
Location: USA
Changed the code to
# adjustment on saturation/value/contrast
# =======================================
    if doLCS==True:
        pdb.python_fu_mod_LCS(inImage, smooth_layer, 0, 0, 144, 80, 160)
    smooth_layer_LCS=inImage.active_layer


Works a treat now. :) :bigthup

_________________
Image
Edmund Burke nailed it when he said, "The only thing necessary for the triumph of evil is for good men to do nothing."


Top
 Post subject: Re: A GIFT FOR OMG
PostPosted: Thu Dec 31, 2015 8:49 am  (#17) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14804
Location: roma, italy
as usual, in my filters I let as default "Flatten = False", so the user has the full set of layers available.
One can easily play with mode on the top layer, to get different results.
Here some example (same photo, only changed the top layer mode)

Attachment:
DSCF0731-cristals-difference.JPG
DSCF0731-cristals-difference.JPG [ 1 MiB | Viewed 1024 times ]

Attachment:
DSCF0731-cristals-grainextract.JPG
DSCF0731-cristals-grainextract.JPG [ 949.08 KiB | Viewed 1024 times ]

Attachment:
DSCF0731-cristals-subtract.JPG
DSCF0731-cristals-subtract.JPG [ 752.82 KiB | Viewed 1024 times ]

_________________
"Where am I ?"


Top
 Post subject: Re: A GIFT FOR OMG
PostPosted: Thu Dec 31, 2015 8:51 am  (#18) 
Offline
GimpChat Member
User avatar

Joined: May 16, 2010
Posts: 14709
Location: USA
Way cooler output using the Python LCS filter! :bigthup

Image

_________________
Image
Edmund Burke nailed it when he said, "The only thing necessary for the triumph of evil is for good men to do nothing."


Top
 Post subject: Re: A GIFT FOR OMG
PostPosted: Thu Dec 31, 2015 9:05 am  (#19) 
Offline
GimpChat Member
User avatar

Joined: Mar 01, 2014
Posts: 12579
Location: Spain, Aragón
Really nice to change the layer mode. :hi5


Attachments:
steam-locomotive-wallpaper-12colours-overlay mode.jpg
steam-locomotive-wallpaper-12colours-overlay mode.jpg [ 497.75 KiB | Viewed 1020 times ]
steam-locomotive-wallpaper-12colours-hue mode.jpg
steam-locomotive-wallpaper-12colours-hue mode.jpg [ 442.38 KiB | Viewed 1020 times ]

_________________
Image

Gimp 2.10.30(samj) portable _ OS Windows 10 Home_ 64bits
Don’t be afraid to start over. It’s a new chance to rebuild what you want.
Top
 Post subject: Re: A GIFT FOR OMG
PostPosted: Thu Dec 31, 2015 9:29 am  (#20) 
Offline
GimpChat Member
User avatar

Joined: Mar 01, 2014
Posts: 12579
Location: Spain, Aragón
and... I had to test it on white and black picture. Fantastic result too. :bigthup :coolthup


Attachments:
waiting for-12colours.jpg
waiting for-12colours.jpg [ 4.98 MiB | Viewed 1019 times ]

_________________
Image

Gimp 2.10.30(samj) portable _ OS Windows 10 Home_ 64bits
Don’t be afraid to start over. It’s a new chance to rebuild what you want.
Top
Post new topic Reply to topic  [ 129 posts ]  Go to page 1, 2, 3, 4, 5 ... 7  Next

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts Attachment(s) A Christmas Gift Box_Tutorial by Conbagui

8



* Login  



Powered by phpBB3 © phpBB Group