ofn-erase-background - Printable Version +- Gimp-Forum.net (https://www.gimp-forum.net) +-- Forum: GIMP (https://www.gimp-forum.net/Forum-GIMP) +--- Forum: Extending the GIMP (https://www.gimp-forum.net/Forum-Extending-the-GIMP) +--- Thread: ofn-erase-background (/Thread-ofn-erase-background) |
ofn-erase-background - Ofnuts - 10-30-2016 A quick script to automate the background erasure when the background is uniform. To use:
RE: ofn-erase-background - Espermaschine - 10-30-2016 I tried it and got a border. Used the Fuzzy Select set at Red 33,2. What did i do wrong ? EDIT: also why is the image displayed in an upscaled way ? Its 640x400px. [attachment=71] RE: ofn-erase-background - Ofnuts - 10-30-2016 (10-30-2016, 03:53 PM)Espermaschine Wrote: I tried it and got a border. Used the Fuzzy Select set at Red 33,2. Can you post the original image? RE: ofn-erase-background - Espermaschine - 10-30-2016 (10-30-2016, 07:25 PM)Ofnuts Wrote: Can you post the original image? Whats wrong with the one i posted ? RE: ofn-erase-background - Ofnuts - 10-30-2016 (10-30-2016, 07:39 PM)Espermaschine Wrote:(10-30-2016, 07:25 PM)Ofnuts Wrote: Can you post the original image? Looking closer at you submission. Since the top image is transparent, I assume this is the result, and the bottom one was the source. The opening post says "script to automate the background erasure when the background is uniform. Which it obviously is not... so the color-to-alpha bit is going to use the "average red" in your image so some bit are not going to be transparent. However your result seems to indicate the script didn't terminate properly, but you should have error messages (dialogs or error console). Anyway while trying to figure out your problem I found another one and fixed it so please re-download the latest (zip file should be 2623 bytes). What I get with your image is: [attachment=72] RE: ofn-erase-background - Espermaschine - 10-30-2016 I wanted to simulate "artifacts" you mention in the documentary, so i added a bit of a slightly different red, as a lot of images you get, have a slight variation of color in their backgrounds. There were no error messages or anything like that. It appears to me, the red border at the edges of the image and around the circle, is where the selection was expanded but the wrong way around.# EDIT: tried the new plug-in, i still get the same borders around the circle and on the edges. Even when executing the script on an image with pure red... Im attaching the base-image. [attachment=73] RE: ofn-erase-background - Ofnuts - 10-30-2016 Your final image is normal as an intermediate step... but it is what I get when removing the color-to-alpha step from the script. There are only three lines of code at play there: Code: pdb.gimp_image_select_item(image, CHANNEL_OP_REPLACE, savedSelection) Also AFAIK if the code crashes you'll get a message. If you have the error console the messages are quietly logged there and easily overlooked. Have you got a saved selection channel? RE: ofn-erase-background - Ofnuts - 10-30-2016 Try this
Code: image=gimp.image_list()[0] Is the white background removed? PS: when the script ends, have you got a selection? Is it the original one, or has it been shrunk or grown? RE: ofn-erase-background - Espermaschine - 10-30-2016 Ok, so i made a black circle on a white background. Did as you told me. The white gets removed, but the progression bar, saying 'color gets removed' is somewhat stuck at approx. 90% The progression bar disappears as soon as i close the console. There is no selection, just a black circle on a transparent BG. RE: ofn-erase-background - Ofnuts - 10-31-2016 Still can't tell what is wrong on your system and not on mine Just in case this is the C2A plugin, I changed the code to use the bucket-fill in color-erase mode, which is strictly equivalent. Can you donwload latest (zip is 2723 bytes) and give it a shot? @everyone else: anyone else tried the script? Same problem, or OK for you? |