# \[HELP\] Bulk change the name of kpp brushes

**URL:** <https://krita-artists.org/t/help-bulk-change-the-name-of-kpp-brushes/45121>\
**Category:** General Questions\
**Created:** [August 4, 2022, 8:31am UTC](https://krita-artists.org/t/help-bulk-change-the-name-of-kpp-brushes/45121 "2022-08-04T08:31:22Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![TigerForge](https://krita-artists.org/user_avatar/krita-artists.org/tigerforge/32/48443_2.png) [@TigerForge](https://krita-artists.org/u/TigerForge)\
**Post date:** [August 4, 2022, 8:31am UTC](https://krita-artists.org/t/help-bulk-change-the-name-of-kpp-brushes/45121/1 "2022-08-04T08:31:23Z")

</div>

Hello,  
I made 120 brushes (so I have 120 .kpp files). I need to change their names (not the file name, I mean the name property).

I can do it in Krita (using the Resource Manager) but doing it with 120 brushes is a “little bit” frustrating 🙂

Is there a way to make this operation faster or easier? For example, using ImageMagick or some tools?

Thanx!

---

<div class="post-metadata">

**Author:** ![Michelist](https://krita-artists.org/user_avatar/krita-artists.org/michelist/32/65826_2.png) [@Michelist](https://krita-artists.org/u/Michelist)\
**Post date:** [August 4, 2022, 9:03am UTC](https://krita-artists.org/t/help-bulk-change-the-name-of-kpp-brushes/45121/2 "2022-08-04T09:03:46Z")

</div>

Well, I’d be interested in that too, I only know the method via the brush editor so far.  
But maybe one could find a way, because I use the tool [“Krita Brush Info”](https://github.com/KennethEvans/VS-KritaBrushInfo) by Kenneth Evans to read out preset information, and that uses [“ExifTool” by Phil Harvey](https://exiftool.org/) to read out the presets.  
So I could imagine that, with help of these tools, one could find a way to locate the name string stored in the presets and then possibly change it, if one can already read out the presets settings with these tools. But this would require some research and testing to see if the integrity of the KPP’s would be preserved by such an intervention, or if you would have to completely regenerate the entire header, for example. Unfortunately, this is way beyond my script pushing abilities.

Michelist

---

<div class="post-metadata">

**Author:** ![halla](https://krita-artists.org/user_avatar/krita-artists.org/halla/32/18581_2.png) [@halla](https://krita-artists.org/u/halla)\
**Post date:** [August 4, 2022, 9:10am UTC](https://krita-artists.org/t/help-bulk-change-the-name-of-kpp-brushes/45121/3 "2022-08-04T09:10:51Z")

</div>

kpp files are png files, so any tool that can change the TEXT segment should work. The brush properties are XML, so parsing that is easy. I think you should be able to use the code from [Brush Fixer for brushes created in Krita 5.1 beta 1](https://krita-artists.org/t/brush-fixer-for-brushes-created-in-krita-5-1-beta-1/44075) as a starting point – it loads the preset as a QImage, uses QImage::text to get the text segment, manipulates it, then sets the text back and saves the file.

---

<div class="post-metadata">

**Author:** ![TigerForge](https://krita-artists.org/user_avatar/krita-artists.org/tigerforge/32/48443_2.png) [@TigerForge](https://krita-artists.org/u/TigerForge)\
**Post date:** [August 4, 2022, 9:33am UTC](https://krita-artists.org/t/help-bulk-change-the-name-of-kpp-brushes/45121/4 "2022-08-04T09:33:56Z")

</div>

Hi halla,  
thanks for this suggestion! Actually, it seems to be the right path to follow.  
In case I make it work, I’ll share a plugin for the people who may have my need.

Thanx!  
Stefano

---

<div class="post-metadata">

**Author:** ![EyeOdin](https://krita-artists.org/user_avatar/krita-artists.org/eyeodin/32/2662_2.png) [@EyeOdin](https://krita-artists.org/u/EyeOdin)\
**Post date:** [August 4, 2022, 10:59am UTC](https://krita-artists.org/t/help-bulk-change-the-name-of-kpp-brushes/45121/5 "2022-08-04T10:59:34Z")

</div>

I wanted to create a plugin that would partially solve this issue I just did not have time for it yet. Just to say it will come to be too I already have the name allocated on GitHub even. But I need to do my commissions first.

---

<div class="post-metadata">

**Author:** ![LunarKreatures](https://krita-artists.org/user_avatar/krita-artists.org/lunarkreatures/32/231342_2.png) [@LunarKreatures](https://krita-artists.org/u/LunarKreatures)\
**Post date:** [August 4, 2022, 11:19am UTC](https://krita-artists.org/t/help-bulk-change-the-name-of-kpp-brushes/45121/6 "2022-08-04T11:19:43Z")

</div>

> **[GitHub - LainFenrir/krita-preset-renamer: A set of scripts to rename krita...](https://github.com/LainFenrir/krita-preset-renamer)**
>
> A set of scripts to rename krita presets. . Contribute to LainFenrir/krita-preset-renamer development by creating an account on GitHub.

A while ago i did some scripts to do that. These are pure python scripts, not krita scripts or plugins. Has been a while since i last used them but you can try using it.

---

<div class="post-metadata">

**Author:** ![TigerForge](https://krita-artists.org/user_avatar/krita-artists.org/tigerforge/32/48443_2.png) [@TigerForge](https://krita-artists.org/u/TigerForge)\
**Post date:** [August 4, 2022, 12:00pm UTC](https://krita-artists.org/t/help-bulk-change-the-name-of-kpp-brushes/45121/7 "2022-08-04T12:00:21Z")

</div>

Thanx to all for your help.

I preferred to follow the @halla suggestion because it’s a more Krita-friendly solution. It worked and I renamed all my brushes.

In my very personal opinion, it should be a built-in feature in Krita, but I understand that there are a lot of features and fixes with a higher priority.

EDIT:

I noticed that the renamed brushes work correctly, but in the Log Viewer this message appears (only the first time) when I select a brush:

WARNING:  
KisResourceLocator::loadRequiredResources failed to sanity check the embedded resource:  
parent resource: KoResourceSignature(“paintoppresets”, “”, “TFSB\_\_Bold\_\_42.kpp”, “TFSB Bold 42”)  
embedded resource: KoResourceSignature(“patterns”, “b31dac2e165bf8e93691ccf62184ba88”, “bold-42.pat”, “\u001F(bold-42.pat)”)

It’s not a blocking warning, it’s just annoying to see. May I have to recalculate that signature code in some way?

---

<div class="post-metadata">

**Author:** ![LunarKreatures](https://krita-artists.org/user_avatar/krita-artists.org/lunarkreatures/32/231342_2.png) [@LunarKreatures](https://krita-artists.org/u/LunarKreatures)\
**Post date:** [August 4, 2022, 1:02pm UTC](https://krita-artists.org/t/help-bulk-change-the-name-of-kpp-brushes/45121/8 "2022-08-04T13:02:44Z")

</div>

My approach was made to be used without needing to open krita as at the time i also didn’t know how to script in krita. But i agree with you this should be in krita. I think someone made a feature request for it too

---

<div class="post-metadata">

**Author:** ![tiar](https://krita-artists.org/user_avatar/krita-artists.org/tiar/32/22_2.png) [@tiar](https://krita-artists.org/u/tiar)\
**Post date:** [August 4, 2022, 1:02pm UTC](https://krita-artists.org/t/help-bulk-change-the-name-of-kpp-brushes/45121/9 "2022-08-04T13:02:56Z")

</div>

Have you changed the pattern names as well?

---

<div class="post-metadata">

**Author:** ![TigerForge](https://krita-artists.org/user_avatar/krita-artists.org/tigerforge/32/48443_2.png) [@TigerForge](https://krita-artists.org/u/TigerForge)\
**Post date:** [August 4, 2022, 1:09pm UTC](https://krita-artists.org/t/help-bulk-change-the-name-of-kpp-brushes/45121/10 "2022-08-04T13:09:54Z")

</div>

No, I have just changed the name of the brush.  
Practically, when I read the “preset” field from the .kpp file and I got the XML string

```auto
<Preset name="my_old_name" paintopid="paintbrush"> <param type="string...

```

I just replace “my\_old\_name” with a new name. I do only this. I don’t change any other part of the XML.

---

<div class="post-metadata">

**Author:** ![TigerForge](https://krita-artists.org/user_avatar/krita-artists.org/tigerforge/32/48443_2.png) [@TigerForge](https://krita-artists.org/u/TigerForge)\
**Post date:** [August 5, 2022, 7:51am UTC](https://krita-artists.org/t/help-bulk-change-the-name-of-kpp-brushes/45121/11 "2022-08-05T07:51:44Z")

</div>

Any suggestion on how to resolve the sanity check warning on the embedded resource?

KoResourceSignature(“patterns”, “b31dac2e165bf8e93691ccf62184ba88”, “bold-42.pat”, “\u001F(bold-42.pat)”)

---

<div class="post-metadata">

**Author:** ![system](https://krita-artists.org/uploads/default/original/1X/e446d8b3077ddf6dfb5b2cd65199c20095b47dcf.png) [@system](https://krita-artists.org/u/system)\
**Post date:** [August 20, 2022, 7:52am UTC](https://krita-artists.org/t/help-bulk-change-the-name-of-kpp-brushes/45121/12 "2022-08-20T07:52:10Z")

</div>

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.
