Remove the python2 rmtrans tool (#5014)
It seems unused, as there's: * Wiki: no mention of rmtrans * main Git repo: only the brief paragraph in the tools readme * resources repo: no mention of it * forums: only as part of a general list of Python files * Github issues and PRs: only as part of a general list of Python files FWIW, I think it's already possible to do with Gimp's default tools ("Colors", "Curves ...", select channel "Alpha", select curve type "Freehand", click in the bottom-left of the box and sweep down, then to the left edge of the box, then as far right as required).
This commit is contained in:
parent
7f9eebdf49
commit
ebbd9c5dfa
3 changed files with 0 additions and 54 deletions
|
@ -4,12 +4,6 @@ also belong here. Other utils are in utils/.
|
|||
|
||||
== Scripts ==
|
||||
|
||||
=== rmtrans ===
|
||||
|
||||
Remove nearly transparent pixels from images using GIMP. It currently affects
|
||||
only one image at a time. Batch processing is available within GIMP, but it
|
||||
would be useful to expand this to skip files where the pixels did not change.
|
||||
|
||||
=== `tmx_trackplacer` ===
|
||||
|
||||
Converter for journey track files, the .cfg files which control the icon
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
This is a GIMP script, written in python.
|
||||
See the following address to install the script:
|
||||
https://en.wikibooks.org/wiki/GIMP/Installing_Plugins#Copying_the_plugin_to_the_GIMP_plugin_directory
|
||||
|
||||
When installed, the script will be listed under the "Colors" menu.
|
||||
|
||||
It requires a relatively recent version of GIMP. 2.6 is too old.
|
|
@ -1,41 +0,0 @@
|
|||
#!/usr/bin/env python2
|
||||
|
||||
from gimpfu import *
|
||||
|
||||
def rmtrans(img,tdrawable):
|
||||
pdb.gimp_image_undo_group_start(img)
|
||||
if pdb.gimp_selection_is_empty(img):
|
||||
pdb.gimp_selection_all(img)
|
||||
selection = pdb.gimp_selection_save(img)
|
||||
pdb.gimp_selection_none(img)
|
||||
alpha,temp,temp,temp = pdb.plug_in_decompose(img,tdrawable,"Alpha",1) # get alpha channel
|
||||
alpha = pdb.gimp_image_get_active_layer(alpha) # turn it into a layer
|
||||
pdb.gimp_edit_copy(alpha)
|
||||
pdb.gimp_floating_sel_to_layer(pdb.gimp_edit_paste(tdrawable,TRUE))
|
||||
alpha = pdb.gimp_image_get_active_layer(img) # move alpha layer into image (copy-paste)
|
||||
pdb.gimp_context_set_antialias(False)
|
||||
pdb.gimp_context_set_sample_threshold(0.0) # configuration for color selection
|
||||
for i in xrange(10):
|
||||
pdb.gimp_image_select_color(img,CHANNEL_OP_REPLACE,alpha,(i,i,i)) # select alpha values <= 10
|
||||
pdb.gimp_image_select_item(img,CHANNEL_OP_INTERSECT,selection) # bound it to the previously selected area (before plugin execution)
|
||||
if not(pdb.gimp_selection_is_empty(img)):
|
||||
pdb.gimp_edit_clear(tdrawable) # and clear it
|
||||
print(alpha)
|
||||
pdb.gimp_image_remove_layer(img,alpha)
|
||||
pdb.gimp_selection_none(img)
|
||||
pdb.gimp_image_undo_group_end(img)
|
||||
|
||||
register(
|
||||
"python_fu_rmtrans",
|
||||
"Remove all pixels under a given alpha threshold.",
|
||||
"Remove all pixels under a given alpha threshold.",
|
||||
"Samuel Kim",
|
||||
"Samuel Kim",
|
||||
"2012",
|
||||
"<Image>/Colors/Remove almost-transparent pixels",
|
||||
"*",
|
||||
[],
|
||||
[],
|
||||
rmtrans)
|
||||
|
||||
main()
|
Loading…
Add table
Reference in a new issue