CSP brush png extractor

Hello.
I made a python script that can extract the png layers from a sut file (brush file from CSP).
I don’t know where to deposit it, and it’s not dumb proof, but you can use it freely.
Of course, if some one want to make a new plugin for Krita, you’re welcome ! :slight_smile:

If some Great Spirit of the Forum Laws can guide me, i will post here or somewhere else my script ^^.

Ok, found a solution :

4 Likes

It would be great if someone could make it as a plug-in for krita. It only needs to be separated into different layers with the appropriate size. Then we can easily convert it to gih animation brush

idea is interesting, but:

  • There’s no license
  • And no example file

On my side, I won’t take code without knowledge of license, and also doesn’t copy code without example file to process (because I can’t test by myself if code is working or not…)

From code here, it seems CSP brush files are sqlite database. Interesting. It’s something “open”, then I suppose it’s not an illegal thing to provide code for that.
But are the brushes can be copied/provided to anyone?
Also, is it allowed to extract brush content (png data file) to make a Krita brushe?

I mean, if you do it at home just for you I suppose it’s “ok” (“ok” as nobody knows what you’re doing…)
If you start to use provide Krita brushes made from CSP data I’m not sure if it’s allowed or not :man_shrugging:

Grum999

1 Like

Yes, I don’t recommend distributing brushes made by others. But the plugin itself is just an “import png from sut to krita layer” tool. It’s no different from the image you import with the abr brush

1 Like

It’s only here as a “dowhatyouwantwithit” file.
You can test it by making a directory where you put your sut files, then launching the script with the directory as a parameter… There is a small “doc” when you start the script without the parameter :).

I posted it because i found persons in the same situation as i, who got free brushes, or payed brushes, but who were not able to use those brushes.
The only advises i found only told them to make a few screenshots, then create new brushes.
I hope this script will help them :slight_smile:

It’s possible to extract a lot of info from CSP data, but i don’t think i will do it…I don’t need it :slight_smile:

So you are fine with people using it in whatever way, is that right? If so, it would be best if you licensed it for example with MIT license. Just add a file called “LICENSE” in that folder, with this content:

Click here to see

Copyright © 2021 Gandahar

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

That way people who knew how to make a Python plugin can take that code and make a Krita plugin out of it. If there is no license file, it’s kind of difficult to say what is allowed and what is not. And if you put that license I showed above, then basically everyone can get and use that code except for claiming that they wrote it themselves. So it kind of makes your “dowhatyouwantwithit” legal. It’s a very common license in open source world so you’re pretty safe using it :slight_smile:

Another license to think about is GPL, which is how the plugin will have to be licensed, because that’s also a license of Krita. But then there are both permissions and limitations: for example if one uses GPL code, then the result must also be GPL. And if they give you a product made with GPL license, then you need to get the source code of that product too. MIT license (the one I showed above) doesn’t have those limitations and it makes it possible to for example make a commercial program with closed source that uses your code. Here is a full content of GPL license if you want it: The GNU General Public License v3.0 - GNU Project - Free Software Foundation

Oh, that’s funny – csp brush files are sqlite databases, just like clip studio image files :slight_smile:

Does that mean it would be theoretically possible to make CSP files importable in Krita? (I have no experience whatsoever with coding)

Added License and Readme…

Gremriel : YES :slight_smile: but no :slight_smile:
I found on other forums that CSP brushes have more parameters than Krita brushes.
But i think it’s possible to make the minimal transformations needed to have a functionnal brush…

The actual layer format for clip studio files is not documented, but it’s pretty fun to actually look inside a file, and see, for instance, how they store text: it’s just plain text with hard-coded linebreaks, like in Krita, and a separate field in the database for the font for that bubble.

As for brushes, I doubt that Clip Studio brushes really have more parameters than Krita brush presets.

1 Like

Will take a look at both, never did a plugin, but it could be fun :smiling_imp:

They are quite different: the blur brush of csp is composed of a certain parameter. It will use a Gaussian blur when swearing color. Krita has filter brush, which supports other functions besides blur.
The mixing settings of Csp not only have the mixing ratio of rgb, but also the mixing ratio of transparency. It also has a parameter similar to “Smudge Length”. If you increase it above 95, the brush will change from “Dulling Mode” to “Smear Mode”. The two modes in Krita are separate, “Smear Mode” is more like sai’s watercolor brush. It is always semi-transparent when it starts, I don’t know if there is a way to change this… Checking “Smear Alpha” is a bit like some extreme cases of csp transparency blending.
Csp also supports the adjustment of the overall transparency of the blending brush (this is strange, such brushes are obviously continuously sampling)
In short, csp does not have so many brush engines, it is very troublesome for you to convert. If you only need to convert multiple patterns of stamp brushes. Then only one gih brushtip is needed (but the related settings of gih are set when exporting, so I just said to import it into the krita layer)