bootchk / resynthesizer

Suite of gimp plugins for texture synthesis
GNU General Public License v3.0
1.47k stars 163 forks source link

a few questions/suggestions #52

Open DavidBrenner3 opened 6 years ago

DavidBrenner3 commented 6 years ago

Hi.

Very good plugin, thank you very much.

Just a few questions/suggestions:

  1. How can I heal non contiguous areas? Every time I try it shows me error. The plugin could divide them into contiguous areas and heal them. Currently I have to select and heal them one at a time, which is not very pleasant...

  2. If the area I want to heal has already most of the background, how can I use this to improve the "reconstruction"? For example, in my work, over 90% of the original background is preserved. For some images, using this plugin is actually making them look worst.

  3. If I want to sample from all the sides but with a different width for each, how can I do it? Or if I want to select an area inside the area to heal... It would be a lot more easy and efficient to include a small editor to select the area(s) to sample.

  4. How about using the heal in Gimp animation too? The user sets it for a frame and Gimp would repeat it for all frames...

Best regards, David

bootchk commented 6 years ago
  1. Requires further study; I wasn't aware this is a problem. AFAIK, the design is intended to work with noncontiguous selections (although I don't think there is a test plan for it.) What is the error message?

  2. Generally, the answer is: user spends more time to select closer to the edge of the flaw, and chooses a smaller corpus width. Maybe I don't understand the use case, and maybe you could provide an example image.

  3. The current "Heal selection" plugin already has more controls than the original. It is a user interface tradeoff: controls that are rarely used require more learning and clutter the user interface. I think (but it is just my opinion) most people would use the Heal tool with a large paintbrush when they already know what corpus area they want to sample from. That said, your suggestion could easily be implemented because it would be in a Python plugin (which is more easy to understand and change.) In other words, a user can do that now using the "Resynthesizer.." menu item (the full control panel) but the user must somewhat laboriously set up different images and selections for the target and the corpus, and a new Python plugin would implement an easier user interface for that process (an "editor" to make two selections, one for the target, and one for the corpus.) I have no plans to implement it, but would probably bundle it if someone else contributed it.

  4. I have limited experience with Gimp animation. But my initial thought is: that would be implemented on the Gimp animation side and would not require any changes to the Resynthesizer.

Thanks for your kind words and interest.

DavidBrenner3 commented 6 years ago

Thank you.

1. error

The selection was made with "Alpha to selection" on another layer, which was deleted, so the selection was "transferred" to this layer. With other plugins I used over the years I had no problems doing this...

  1. Just an example - you can see the background is close to the original (above and below):

sample

bootchk commented 6 years ago
  1. I tested a case, where I made a non-contiguous selection (using the lasso tool, and the Shift key to add to the selection.) That seemed to work (the separate areas were both changed by the plugin, without an error message, although I can't say the results were pleasing.) So I suspect your case is somehow different. The error message you got means "the selection is empty, has zero non-transparent pixels", so I suspect that when you "transferred" the selection (I don't really understand whether the quotes mean you are paraphrasing, or whether there is some GIMP function named "transfer"), that despite what you intended to happen, the selection from the active layer WAS empty. I myself am often surprised by what the GIMP selection really is (especially when it is floating and has not been anchored.) To pursue this further, I would need a detailed description of the exact steps you took.

  2. I opened the image you posted in GIMP, made a rectangular selection around "erma", and chose "Heal selection...". It seemed to work, but that is subjective, and I mean, loosely speaking, it eliminated the ghost "erma" by filling with the blue background. Maybe you mean that whatever subtle gradient is in the blue background was not kept? That is a known weakness of Resynthesizer, it doesn't always maintain gradients. That is why there is a "fill from sides" or "fill from top and bottom" control: to try and maintain a horizontal or vertical gradient.

If you meant something else (you wanted "erma" to remain in the image?), please let me know.

In general, Resynthesizer doesn't always produce a good result. But it often produces something that fools a casual glance.

JohnVV commented 6 years ago

---- quote----- In general, Resynthesizer doesn't always produce a good result. But it often produces something that fools a casual glance. ------------ end quote ---

this is true

i have been using this tool for many many years

normally on something like that example i paint the area ( #ff0000, or #00ff00 ) then select by color and then EXPAND the selection by 2 to 10 pixels depending on the size of the image

then run the program

then

on the few areas that do not look great i repeat the process

test of that image http://imgbox.com/OEVQVcPg

bootchk commented 6 years ago

So you do want to keep that subtle gradient that Resynthesizer is not great with?

This conversation has me thinking again about possible other uses for the Resynthesizer. The features that you want to eliminate are linear, the edges of the lettering. (Sidebar: Resynthesizer also has trouble keeping linear features, say a wire that has a bird on it that you want to erase.) If Resynthesizer returned the coordinates of the best matches (it doesn't currently, it just returns the colors of the best matches) then you might be able to use those coordinates to do edge detection, and use the resulting edges to select themselves, so to speak. Then a second pass of Resynthesizer could erase them. One could use any edge detector to test whether it would create a selection of your example letter edges, and how good Resynthesizer would work on such a selection, instead of just a rectangular selection across the whole lettered word.

A less obvious use of texture transfer algorithms is finding where images have been altered, that is, trying to detect where retouching or healing was done.

The original author has an example where you texture lettered words with cloud textures. Some parallels to your example, but reversed.

Finally, I have tried repeatedly resynthesizing an image from itself (targeting the whole image, from a copy.) Over many repetitions, man made, linear objects tend to go away. Somewhat similar to the repetitions you are doing.