Pigment.O plugin

Hey, I was about to give it a try but it didn’t initialized with krita instead giving me this error log:

> TypeError
Python 3.10.5: /usr/bin/python3
Fri Jul 29 00:42:10 2022

A problem occurred in a Python script.  Here is the sequence of
function calls leading up to the error, in the order they occurred.

 /usr/lib/krita-python-libs/krita/dockwidgetfactory.py in createDockWidget(self=<krita.dockwidgetfactory.DockWidgetFactory object>)
   14         super(DockWidgetFactory, self).__init__(_id, _dockPosition)
   15         self.klass = _klass
   16 
   17     def createDockWidget(self):
   18         return self.klass()
self = <krita.dockwidgetfactory.DockWidgetFactory object>
self.klass = <class 'pigment_o.pigment_o_docker.PigmentO_Docker'>

 /home/demian/.local/share/krita/pykrita/pigment_o/pigment_o_docker.py in __init__(self=<pigment_o.pigment_o_docker.PigmentO_Docker object>)
  327         self.Harmonys()
  328         self.Color_ofthe_Day()
  329         self.Panels()
  330         self.Gamut()
  331         self.Dots()
self = <pigment_o.pigment_o_docker.PigmentO_Docker object>
self.Panels = <bound method PigmentO_Docker.Panels of <pigment_o.pigment_o_docker.PigmentO_Docker object>>

 /home/demian/.local/share/krita/pykrita/pigment_o/pigment_o_docker.py in Panels(self=<pigment_o.pigment_o_docker.PigmentO_Docker object>)
  551 
  552         # Panel UVD
  553         self.panel_uvd = Panel_UVD(self.layout.panel_uvd)
  554         self.panel_uvd.SIGNAL_UVD_VALUE.connect(self.Signal_UVD)
  555         self.panel_uvd.SIGNAL_UVD_RELEASE.connect(self.Pigment_Release)
self = <pigment_o.pigment_o_docker.PigmentO_Docker object>
self.panel_uvd undefined
global Panel_UVD = <class 'pigment_o.pigment_o_modulo.Panel_UVD'>
self.layout = <PyQt5.QtWidgets.QWidget object>
self.layout.panel_uvd = <PyQt5.QtWidgets.QWidget object>

 /home/demian/.local/share/krita/pykrita/pigment_o/pigment_o_modulo.py in __init__(self=<pigment_o.pigment_o_modulo.Panel_UVD object>, parent=<PyQt5.QtWidgets.QWidget object>)
  324         # Start
  325         self.Variables()
  326         self.Cursor()
  327         # Size Hint Expand
  328         self.setSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.MinimumExpanding)
self = <pigment_o.pigment_o_modulo.Panel_UVD object>
self.Cursor = <bound method Panel_UVD.Cursor of <pigment_o.pigment_o_modulo.Panel_UVD object>>

 /home/demian/.local/share/krita/pykrita/pigment_o/pigment_o_modulo.py in Cursor(self=<pigment_o.pigment_o_modulo.Panel_UVD object>)
  357         self.cursor_size = 20
  358         self.cursor_half = self.cursor_size / 2
  359         self.cursor_lmb.setGeometry(QtCore.QRect(-self.cursor_half, -self.cursor_half, self.cursor_size, self.cursor_size))
  360         self.cursor_rmb.setGeometry(QtCore.QRect(-self.cursor_half, -self.cursor_half, self.cursor_size, self.cursor_size))
  361         self.cursor_rmb.resize(0, 0)
self = <pigment_o.pigment_o_modulo.Panel_UVD object>
self.cursor_lmb = <PyQt5.QtSvg.QSvgWidget object>
self.cursor_lmb.setGeometry = <built-in method setGeometry of QSvgWidget object>
global QtCore = <module 'PyQt5.QtCore' from '/usr/lib/python3.10/site-packages/PyQt5/QtCore.abi3.so'>
QtCore.QRect = <class 'PyQt5.QtCore.QRect'>
self.cursor_half = 10.0
self.cursor_size = 20
TypeError: arguments did not match any overloaded call:
  QRect(): too many arguments
  QRect(int, int, int, int): argument 1 has unexpected type 'float'
  QRect(QPoint, QPoint): argument 1 has unexpected type 'float'
  QRect(QPoint, QSize): argument 1 has unexpected type 'float'
  QRect(QRect): argument 1 has unexpected type 'float'
    __cause__ = None
    __class__ = <class 'TypeError'>
    __context__ = None
    __delattr__ = <method-wrapper '__delattr__' of TypeError object>
    __dict__ = {}
    __dir__ = <built-in method __dir__ of TypeError object>
    __doc__ = 'Inappropriate argument type.'
    __eq__ = <method-wrapper '__eq__' of TypeError object>
    __format__ = <built-in method __format__ of TypeError object>
    __ge__ = <method-wrapper '__ge__' of TypeError object>
    __getattribute__ = <method-wrapper '__getattribute__' of TypeError object>
    __gt__ = <method-wrapper '__gt__' of TypeError object>
    __hash__ = <method-wrapper '__hash__' of TypeError object>
    __init__ = <method-wrapper '__init__' of TypeError object>
    __init_subclass__ = <built-in method __init_subclass__ of type object>
    __le__ = <method-wrapper '__le__' of TypeError object>
    __lt__ = <method-wrapper '__lt__' of TypeError object>
    __ne__ = <method-wrapper '__ne__' of TypeError object>
    __new__ = <built-in method __new__ of type object>
    __reduce__ = <built-in method __reduce__ of TypeError object>
    __reduce_ex__ = <built-in method __reduce_ex__ of TypeError object>
    __repr__ = <method-wrapper '__repr__' of TypeError object>
    __setattr__ = <method-wrapper '__setattr__' of TypeError object>
    __setstate__ = <built-in method __setstate__ of TypeError object>
    __sizeof__ = <built-in method __sizeof__ of TypeError object>
    __str__ = <method-wrapper '__str__' of TypeError object>
    __subclasshook__ = <built-in method __subclasshook__ of type object>
    __suppress_context__ = False
    __traceback__ = <traceback object>
    args = ("arguments did not match any overloaded call:\n  Q...ct(QRect): argument 1 has unexpected type 'float'",)
    with_traceback = <built-in method with_traceback of TypeError object>

The above is a description of an error in a Python program. Here is
the original traceback:

Traceback (most recent call last):
  File "/usr/lib/krita-python-libs/krita/dockwidgetfactory.py", line 18, in createDockWidget
    return self.klass()
  File "/home/demian/.local/share/krita/pykrita/pigment_o/pigment_o_docker.py", line 329, in __init__
    self.Panels()
  File "/home/demian/.local/share/krita/pykrita/pigment_o/pigment_o_docker.py", line 553, in Panels
    self.panel_uvd = Panel_UVD(self.layout.panel_uvd)
  File "/home/demian/.local/share/krita/pykrita/pigment_o/pigment_o_modulo.py", line 326, in __init__
    self.Cursor()
  File "/home/demian/.local/share/krita/pykrita/pigment_o/pigment_o_modulo.py", line 359, in Cursor
    self.cursor_lmb.setGeometry(QtCore.QRect(-self.cursor_half, -self.cursor_half, self.cursor_size, self.cursor_size))
TypeError: arguments did not match any overloaded call:
  QRect(): too many arguments
  QRect(int, int, int, int): argument 1 has unexpected type 'float'
  QRect(QPoint, QPoint): argument 1 has unexpected type 'float'
  QRect(QPoint, QSize): argument 1 has unexpected type 'float'
  QRect(QRect): argument 1 has unexpected type 'float'
Summary

This text will be hidden

As on the git hub page:

Linux users to install this plugin also need to:

  • install the “python3-pyqt5-svg” module that is not included in linux
  • use Krita with a appimage.
1 Like

Hello. Thank you for your help with this excellent plugin.

Currently Pigment.O allows me to create a selection by pressing the color selection button, but the “march of the ants” does not show up. However, I found that just by adding the following action to line 5216 of pigment_o_docker.py, the marching ants will be displayed. How about adding it to the code?

    def Menu_SELECTION(self):
        if self.layout.selection.isChecked() == True:
            self.layout.selection.setIcon(Krita.instance().icon('local-selection-active'))
            self.Selection_APPLY()

            #Additional actions
            Krita.instance().action('invert_selection').trigger()
            Krita.instance().action('invert_selection').trigger()

One more thing.
I use the “Fill Pixel” function of Pigment.O most frequently. I find it a very useful feature, so could you please make it possible to set a shortcut key to pressing the Fill Pixel button?

Translated with DeepL Translate: The world's most accurate translator (free version)

6 Likes

I have been reading documentation to try and fix that issue for a while. I feel like invert twice should not be the answer but it works, I would never guess this. Thank you.

Both fill and selection are not fully 100% working (various reasons) but they are so useful I can’t have them hidden. Even broken they are too usefull.

I am reworking pigmento from scratch so this change will take a while to hit GitHub but both changes will happen. That is a good idea.

5 Likes

Hey.
I have question - is there a way to set values for saturation and light in HSL picker to 1-100 insted of 1-255?

Yes there is. You don’t want to do that but the details on how to do it are on the plugin manual.

2 Likes

I came here after trying to find the manual for quite a while. If I may make a suggestion, you could maybe put a prominent note in the readme on github ( as well as the top post here) pointing out that the manual is found in the plugin manager. I seem to recall you complaining about people asking you about stuff that’s in the manual, but honestly I think that may just be because it’s pretty hard to find out that there even is one :smiley:

Edit: Also I think in general, the Github Readme might be a better place for the manual. For one, you can’t mess around with Pigment.O with the manual open, since the plugin manager steals focus.

2 Likes

Hi,

Currently, the shortcut “P.Key 1 Minus” changes the quantity by 1; such that if “Key 1” is set to HSV, using the shortcut “P.Key 1 Minus” decreases the hue by a quantity of 1. I want to be able to use shortcut keys to quickly and drastically change the hue of the color I am using.

Here’s my question: let’s say “Key 1” is set to HSV. Is it possible to configure the shortcut “P.Key 1 Minus” so that it decreases the hue by a quantity of 60 instead of 1?

If you change the code you can.
Also you press and hold it will auto repeat.

I am currently doing wikis. The best example of how it will work is like imagine board is now.

I find it silly overpopulating the readme with instructions that don’t even relate to the plugin but how to use Krita and there is already a manual for it. The readme is the basic info of the code above. If I were to think like that I should introduce the plugin with how to install plugins also. Useless information for the GitHub because I would have to start that on every plugin I make. Sorry but no.

How to install is currently a page in the wiki that should not even be there but it is. But since I am moving out into the wikis teaching people to use the manual is off. Sadly the manual does not allow links but yeah.

Also the wikis allow for a lot more formatting options and display images and animated GIFs. Also I can slap a link to people when they ask me the same question a million times outside of Krita.

I will only write pigmento wiki after the new pigmento comes out though so that will take a while.

That’s fine, I just wanted to point out that the reason you’re getting questions about things that are explained in the manual might partly be because the users simply don’t know there is a manual.

1 Like

Hi EyeOdin,

Thanks for the reply and for creating/constantly managing Pigment. O!

I’m a Mac user, and I don’t know a lot about coding.
If I wanted to change the code(s) for “P.Key 1 Minus”–so that it decreases the quantity by 60 instead of 1–what code(s) do I need to change?
Also, in which file(s) would I find the code(s) to change the configuration of “P.Key 1 Minus?”

Python is easy and that code starts from the extention.py and the signal is received at docker.py. somewhere along the way is the 1 you want to change.

Hi EyeOdin,

Thank you so much for the directions, I was able to configure the shortcuts to my desire!
I’m now able to use shortcut keys to instantaneously increase and decrease the saturation and value by a quantity of 25.5, and the hue by a quantity of 5. (I attached screenshots of the only codes that I had to change, these codes were found in “pigment_o_docker.py.”)

The default HSV_1_Minus code in Pigment O.

The edited HSV_1_Minus in Pigment O.

The default HSV_1_Plus code in Pigment O.

The edited HSV_1_Plus code in Pigment O.

I think you broke it.

Everything seems to be working how it should be.

  1. The shortcut keys are increasing and decreasing the saturation by 25.5, the value by 25.5, and the hue by 5.
  2. The color I created using my edited Pigment O’s shortcut keys is the same color that’s being applied onto the canvas.
  3. The color I created using my edited Pigment O’s shortcut keys is the same color that appears on Krita’s “Advance Color Selector” and “Specific Color Selector,” evidenced by the same hex codes that appears in Pigment O’s channels and Krita’s “Specific Color Selector.”
  4. Krita isn’t acting buggy, nor is Pigment O.

oh it seems your right I did cut the connection to other widgets and now that is exclusive to the shortcuts. all good then.

Hi EyeOdin,

I really like this plugin. It’s like Coolorus from Photoshop, but has way more features.

The only problem I’m experiencing is that whenever I pick color from the canvas, Pigment.O colors don’t update, but colors from the Advanced Color Selector do.

Check if the plugin is ON. It is the lower left button and has 3 states to avoid random conflicts with krita.

Yes, I have it ON. I’ve tried it in the other states, different performance settings, and even reinstalled but still has the issue.