Pigment.O plugin

hello. do you know what panel or color setting to use for the increased similarities?

something with Hue on it should hold more similar results.
But use the dot panel to analyze the path of the colors you want and see what is more pleasing for the eye because at the moment there is no ā€œrightā€ way to do it. they are all equally valid in my mind in some way or another. lately I have been trying out YUV interpolation as it seems to be quite vivid the colors.

2 Likes

The source code of mixbox is open source, because the secret is not in the source code, but in the 3d lookup table (compressed as png). If someone can make a 3d lookup table for gpl, then either pigment.O or krita itself can use this fast and effective color mixing effect.

Do you know what all would be involved in making a 3d lookup table? I own many different paints and pigments and I have a pretty good camera setup, it’s not really in my ability to handle the math of it but I could happily provide source/reference images of how the colors interact with each other.

I think mathematics is indispensable. The reference image serves only as a control at the end.

If you actually took time to watch it and if you are mildly familiar with programming you will understand why it is relevant.
Not only was it explaining why the color mixing everyone uses is wrong but it also had a key line at the end:
ā€œwe are sharing the github repository as opensourceā€. I thought that will be interesting to @EyeOdin .
I think color mixing is a relevant topic to a color picking addon. If not ā€œlet’s mix real paintsā€ then just as a swatch generation. I posted it not because I thought it would be interesting for you but for @EyeOdin.

But I agree that maybe realistic/pigment like mixing might be out of the scope of Pigment.O . Still maybe @EyeOdin someday might get interested in it so knowing something like this is out there is a good thing.

2 Likes

lol on my side I didn’t :sweat_smile:
But I’m not so interested by the subject so…

There was already many discussion about his video here:

Could be a better place to talk about it, because if everyone post the same video and ask the same things, it will be difficult to follow :wink:

Grum999

not asking anything. but whatever

2 Likes

I actually watched the entire presentation. I also checked out the repository, which by the way is source open but not Free software not even open source as per the definition of open source by Opensource Initiative. The license restricts commercial usage, so you can only look and not reuse the code for anything commercial and redistribution. That is not compatible with Krita’s or any other opensource license.

Regarding the offtopic message, I asked because this is a topic of a colour selector plugin for Krita and you did not add anything about how it will be useful in case of pigmento. Seems like @EyeOdin has not problem with it and I miss understood so sorry about that.

It is only for viewing and personal use. it restricts commercial usage so it is not under open source license as defined by Open source initiative and definitely not by Free Software foundation. So even if they give us the chance to look at the code we can’t really do anything about it.

I mean what’s really important to them is not public. That’s how to specifically make a 3d lookup table of spectral mixing. If someone is willing to choose the pigment to measure the color gamut, optimize the color gamut space, improve the algorithm, and finally make several png data pictures. That has nothing to do with them violating their rights.
They generally published the method in the paper, and only png data in the code. We make another piece of data that has nothing to do with it.

to my understanding the restriction is not in the logic of the algorithm but the code. Thus if you don’t copy 1:1 the code and present it as your own then that should be ok. Nothing like a stackoverflow copy - paste. Otherwise what’s the point of allowing people to view it if they can’t even replicate the logic. But I’m bad with licenses I must admit.

As for Krita…to be honest I’m not quite sure what’s the concept behind Krita’s license…it is supposed to be free and open source, yet Krita is being sold on Steam. On the other hand Blender is free everywhere. Anyway, not a topic to be discussed here , or a topic I’m that interested in.

I actually had doubts on that point. They do intend to sell it somehow. But the document for the SIGGRAPH is open no?

Honestly I would probably be more keen to code from the theory than to convert the original code as it seems to complicated to me and I still can’t read cpp fluently.

I have plans to add more stuff to the mixers since I started thinking RGB linear was not enough and started to add colour spaces to it. I even have an original idea on how to mix differently that hopefully approximates to natural mixing with less effort. But as always is just another dumb idea so odds of it really working are questionable but it will happen eventually. But I will probably have to create a 3d RGB cube for colour paths to check results and I was hoping Pyqt6 for that as 3d display currently seems with little learnning information for 3d in Pyqt5 and soon to be changed either way. Maybe a export to blender? No idea how too send so on hold.

After this update I fixed alot of old crippling bugs that were on the list so now I can make some new stuff as I try to illustrate. For now I was working on the scanner. Been looking into okhsv too but there seems to be a lot of dependencies to just plug it in straight up.

1 Like

Free in the ā€œFree Softwareā€ is not about the price but about the freedom. The license Krita doesn’t restrict selling Krita. But this is a discussion for another new topic in a forum not in this thread :slightly_smiling_face:

In my experiments, the largest gamut you can achieve using 3 pigments is using Cadmium Yellow Light/Benzimidazolone Yellow Light, Quinacridone Magenta, and Phthalo Blue Green Shade. Obviously you can push this gamut further out using additional pigments such as Pyrrole Red, Anthraquinone Blue/Ultramarine Blue, and Cobalt Teal.

People have already plotted out where different pigments lie in the color spectrum as well.


(image taken from www.handprint.com)

I’ve seen several examples of people over the years creating software which can predict how pigments will mix together to aid traditional painters in color mixing. It might be of use for this instance. Here’s some examples

(this program is incredibly comprehensive for this purpose) UniBS Zsolt M. Kovacs-Vajna - Color Mixing Tools
kindofdoon: The Blog of Daniel W. Dichter: Paint Palette to Color Gamut
https://arxiv.org/pdf/1707.08323.pdf
ColorSpace by Philippe Colantoni is an excelent visualizer for this apparently, but I haven’t been able to get in contact with him.

I know this was a tangent, but I feel like there could be something of use for you guys in it.

what I need is math equations that actually work though and not just to a couple of colors. seeing others do it behind closed doors is not really useful to me. I was aware of those programs already.

pigment.O has been updated a few times recently, is it an experimental version?

Minor corrections.

2 Likes

I was playing with stuff around with the IMG panel and noticed that when dragging an image from the internet would accept but obviously would not have a valid path to the disk to reload again. Also cropped images and dropping them in would invalidate the cropping on the next session. Just one I would accept not working but both I thought I should change to work properly. So now it accepts a image and makes a copy image into it’s own folder.

Now you have the default image as normal and the save image that is a duplicated of the image you select/drop inside. This ensures you have a save path for the images dragged from the internet and the crops from the disk.

4 Likes

Hi! @EyeOdin

Using Krita for 3-4 years and it’s great software, recently I found out about this plugin and I’d like to try it, because it looks awesome (seems more powerful than standard color picker imo, especially that sphere view), however I’ve encountered one issue. Namely after installing via web in Krita (using GitHub link) and then after restarting, Krita won’t load plugin due to ā€œunexpected type ā€˜floatā€™ā€ error. Then it crashes - currently the only solution to make Krita work again is to delete plugin from folder (in my case /home/~username~/.local/share/krita/pykrita). I’d be grateful for providing me solution to this issue :slight_smile:

Specs (if necessary):
OS: Arch Linux
Kernel: x86_64 Linux 5.16.14-arch1-1
Shell: bash
DE: KDE 5.91.0 / Plasma 5.24.3
WM: KWin
CPU: Intel Core i7-7700HQ @ 8x 3.8GHz
GPU: Mesa Intel(R) HD Graphics 630 (KBL GT2)
RAM: 24 GB
Python 3.10.2

Here’s log below:

TypeError
Python 3.10.2: /usr/bin/python3
Sun Mar 13 10:39:32 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/outermind/.local/share/krita/pykrita/pigment_o/pigment_o_docker.py in __init__(self=<pigment_o.pigment_o_docker.PigmentO_Docker object>)
  322         self.Harmonys()
  323         self.Color_ofthe_Day()
  324         self.Panels()
  325         self.Gamut()
  326         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/outermind/.local/share/krita/pykrita/pigment_o/pigment_o_docker.py in Panels(self=<pigment_o.pigment_o_docker.PigmentO_Docker object>)
  572     def Panels(self):
  573         # Panel UVD
  574         self.panel_uvd = Panel_UVD(self.layout.panel_uvd)
  575         self.panel_uvd.SIGNAL_UVD_VALUE.connect(self.Signal_UVD)
  576         self.panel_uvd.SIGNAL_UVD_RELEASE.connect(self.Pigment_Display_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/outermind/.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>)
  174         # Start
  175         self.Variables()
  176         self.Cursor()
  177         # Size Hint Expand
  178         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/outermind/.local/share/krita/pykrita/pigment_o/pigment_o_modulo.py in Cursor(self=<pigment_o.pigment_o_modulo.Panel_UVD object>)
  207         self.cursor_size = 20
  208         self.cursor_half = self.cursor_size / 2
  209         self.cursor_lmb.setGeometry(QtCore.QRect(-self.cursor_half, -self.cursor_half, self.cursor_size, self.cursor_size))
  210         self.cursor_rmb.setGeometry(QtCore.QRect(-self.cursor_half, -self.cursor_half, self.cursor_size, self.cursor_size))
  211         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/outermind/.local/share/krita/pykrita/pigment_o/pigment_o_docker.py", line 324, in __init__
    self.Panels()
  File "/home/outermind/.local/share/krita/pykrita/pigment_o/pigment_o_docker.py", line 574, in Panels
    self.panel_uvd = Panel_UVD(self.layout.panel_uvd)
  File "/home/outermind/.local/share/krita/pykrita/pigment_o/pigment_o_modulo.py", line 176, in __init__
    self.Cursor()
  File "/home/outermind/.local/share/krita/pykrita/pigment_o/pigment_o_modulo.py", line 209, 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'