Switch to full style
Post all Gimp scripts and script writing questions here
Post a reply

pm_icon_pressed_effect.py

Tue Aug 25, 2020 10:57 pm

For this plugin to work as expected you need to create a 500 x 500 px icon gray-scale with transparency and save it as .gbr

Select a brush from GIMP brushes dialog and click OK. The script will produce a pressed icon with the current brush.

Ps I manage to create some media icons for your convenience, use them as you will. Have fun creating your icons.


These are sample created with the plugin:

Image
Image
Image
Image

Re: pm_icon_pressed_effect.py

Wed Aug 26, 2020 1:37 am

Nicely done Pocholo, but could a use active brush option be used as it would save typing in the brush name.

Re: pm_icon_pressed_effect.py

Wed Aug 26, 2020 7:59 am

Graechan wrote:
Nicely done Pocholo, but could a use active brush option be used as it would save typing in the brush name.


Thank you Graechan. Can you give me an example of what you're referring "active brush option"?

Re: pm_icon_pressed_effect.py

Wed Aug 26, 2020 9:22 am

Means that the brush being currently active, is used.
gimp-context-get-brush?

This looks like the mini-tut I made year ago ;)

viewtopic.php?f=10&t=17733

Re: pm_icon_pressed_effect.py

Wed Aug 26, 2020 1:01 pm

Nidhogg wrote:Means that the brush being currently active, is used.
gimp-context-get-brush?

This looks like the mini-tut I made year ago ;)

viewtopic.php?f=10&t=17733


It's actually one of conbagui's tutorials which can be found here: https://www.deviantart.com/conbagui/art ... -817657875

Re: pm_icon_pressed_effect.py

Wed Aug 26, 2020 1:39 pm

Nidhogg wrote:Means that the brush being currently active, is used.
gimp-context-get-brush?

This looks like the mini-tut I made year ago ;)

viewtopic.php?f=10&t=17733


So, how about that? Two users almost at the same time creating a this tutorial. :jumpclap

Re: pm_icon_pressed_effect.py

Wed Aug 26, 2020 2:03 pm

Pocholo, I tried your plugin and I came up with this:
Image

The image I used was this one: Image

I know the image isn't grey scale but it is transparent and the plugin works.

Re: pm_icon_pressed_effect.py

Wed Aug 26, 2020 2:36 pm

mackenzieh wrote:Pocholo, I tried your plugin and I came up with this:
[ Image ]

Is there a way to change the background color before creating the icon?
The image I used was this one: [ Image ]

I know the image isn't grey scale but it is transparent and the plugin works.


No. You created an RGB brush when you did not make it as Gray scale. GIMP have a procedure for the image and not for a particular item. You need to convert to "gray scale" before you create the brush.

Gray scale brushes will paint the image using the palette Foreground/Background.

Re: pm_icon_pressed_effect.py

Wed Aug 26, 2020 2:51 pm

@Graechan and Nidhogg: I changed it for the Current brush so you can choose the brush in the Brushes dialog before running the script, and I changed the file on the initial thread. Thank you guys for the input. :hi5

Re: pm_icon_pressed_effect.py

Wed Aug 26, 2020 3:03 pm

Pocholo wrote:
mackenzieh wrote:Pocholo, I tried your plugin and I came up with this:
[ Image ]

Is there a way to change the background color before creating the icon?
The image I used was this one: [ Image ]

I know the image isn't grey scale but it is transparent and the plugin works.


No. You created an RGB brush when you did not make it as Gray scale. GIMP have a procedure for the image and not for a particular item. You need to convert to "gray scale" before you create the brush.

Gray scale brushes will paint the image using the palette Foreground/Background.


Oh. I'll try it again but the script still works if even the the image isn't grayscale. I was just showing you that the plugin still works whether the image is grey scale or not.

Edit: Here's the grayscale icon instead of the one I created by accident which wasn't grayscale: Image

Re: pm_icon_pressed_effect.py

Thu Aug 27, 2020 9:20 am

Pocholo wrote:@Graechan and Nidhogg: I changed it for the Current brush so you can choose the brush in the Brushes dialog before running the script, and I changed the file on the initial thread. Thank you guys for the input. :hi5

That's good. Can you attach the updated plug-in in the first post to test it, thank you.

Re: pm_icon_pressed_effect.py

Thu Aug 27, 2020 2:18 pm

Nidhogg wrote:
Pocholo wrote:@Graechan and Nidhogg: I changed it for the Current brush so you can choose the brush in the Brushes dialog before running the script, and I changed the file on the initial thread. Thank you guys for the input. :hi5

That's good. Can you attach the updated plug-in in the first post to test it, thank you.


I already did it. I have some help from MareroQ also.

Re: pm_icon_pressed_effect.py

Thu Aug 27, 2020 3:57 pm

In the plugin interface there is the option to choose the brush color and also the background color.
But the results are always in the same colors.

Re: pm_icon_pressed_effect.py

Thu Aug 27, 2020 7:39 pm

Sorry krikor, I uploaded the unfinished script. I uploaded the right one now

Go ahead and download it again and let me know.

Re: pm_icon_pressed_effect.py

Thu Aug 27, 2020 8:55 pm

Pocholo,

It works for me.
Image

Re: pm_icon_pressed_effect.py

Fri Aug 28, 2020 8:17 am

Pocholo wrote:Sorry krikor, I uploaded the unfinished script. I uploaded the right one now

Go ahead and download it again and let me know.

Pocholo, now the color selection is ok!
But ... the color generated for Icon-Dropshadow remains Wallace's color, be7dcf, regardless of the selected colors.

Thanks for the plugin and for updating it.

Re: pm_icon_pressed_effect.py

Fri Aug 28, 2020 2:40 pm

Krikor wrote:
Pocholo wrote:Sorry krikor, I uploaded the unfinished script. I uploaded the right one now

Go ahead and download it again and let me know.

Pocholo, now the color selection is ok!
But ... the color generated for Icon-Dropshadow remains Wallace's color, be7dcf, regardless of the selected colors.

Thanks for the plugin and for updating it.


Open the script with a text editor and change the color on the line 122 to white (255, 255, 255)

Code:
120 #Drop Shadow
121   pdb.python_layerfx_drop_shadow(img, iconLayer,
122                       (255, 255, 255),   #color

Re: pm_icon_pressed_effect.py

Fri Aug 28, 2020 5:46 pm

Krikor,

The plugin works for me.

Here's default:
Image

Here's one with different colors:
Image
Post a reply