Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Blur, change mode, save as
#2
For what you want to do, typically you don't "undo". You duplicate the starting image (once for each blur level) and apply your changes to the copy then throw away the copy after you have exported it. This is much faster because since the copy is throw-away, you can totally disable undo on it.

And undo-group-{start/end} don't enable the undo, they just lump whatever happens between the two as one undo step in the UI, so typically you bracket all the code of your script with them, and the user can undo your script with one Ctrl-Z, instead of one Ctrl-Z per change done in your code...

Do you really need the image to be indexed or do you just want 5 levels of gray? Because if you use auto-indexing, 1) you get a different color map for each image, which can be a problem down the line and 2) you aren't even sure that you get exactly the same result each time (since there is a bit of randomness involved). if you just want 5 levels of gray you can use gimp-drawable-posterize (see Colors ➤ Posterize in the UI).

Given the questions that you are asking you have not written much code before?

Do you know you can also write the scripts in Python, which is a much simpler language?
Reply


Messages In This Thread
Blur, change mode, save as - by tkemmere - 11-21-2022, 09:50 AM
RE: Blur, change mode, save as - by Ofnuts - 11-21-2022, 11:12 AM
RE: Blur, change mode, save as - by tkemmere - 11-21-2022, 12:11 PM
RE: Blur, change mode, save as - by Ofnuts - 11-21-2022, 12:40 PM
RE: Blur, change mode, save as - by tkemmere - 11-21-2022, 10:47 PM
RE: Blur, change mode, save as - by Ofnuts - 11-21-2022, 11:42 PM
RE: Blur, change mode, save as - by rich2005 - 11-22-2022, 01:30 PM
RE: Blur, change mode, save as - by tkemmere - 11-22-2022, 10:49 PM
RE: Blur, change mode, save as - by tkemmere - 11-23-2022, 10:39 PM

Forum Jump: