How to move disturbing area out of the picture with liquify?

I try to get rid of a blue window edge that draws too much attention away from the subject of the photo. Liquify seems perfect for the use case, but I cannot manage to make it work.

I try to extend the white area towards the edge such that the blue window is shifted out of the image. Unfortunately, whatever I try, an oval line appears.

Any explanation and suggestions how to make it work?

Do you have a reason for not using the spot removal tool? Seems to me it’s perfect for the job.

In that picture it may work, but in general I think it blends too harsh for most purposes, and you do not always have a region to copy. Often, liquify works much better and I had cases where it worked perfectly. I really want to understand the liquify behaviour.

Crop & Rotate

I know several workarounds, in the given image even lens correction shifts the window out of sight. But I really want to understand the behaviour of liquify.

I’d usually just desaturate using the tone curve or color zone module.

:thinking: Is this is the right tool? In the manual it says:

The liquify module offers a versatile way of moving pixels around by applying free style distortions to parts of the image. There are three tools to help doing that: points, lines, and curves.

This doesn’t sound like a tool that “moves objects outside of the frame because I don’t like them” :stuck_out_tongue:. In-painting (spot removal) and liquid-resize (resynthesizer in GIMP; does dt have this?) tools might be more appropriate.

PS “to help doing that” → “to help do that”?

Oh, to me your citation sounds exactly like that. Moving pixels around is what I want to do. It’s not a large object but rather a little blue “line” at the edge, as you can see from the screenshots above.

The image from the manual shows exactly that use case, the only difference is that it’s not at the edge of the image. To me, what happens looks like some kind of mirroring of the structure to the left. I still want to understand what’s going on.

The technique I try here works often much better than inpainting, furthermore these tools you mention are not available in darktable.

I really want to understand how it works, what I am doing wrong or where my wrong assumption is (or maybe if it is a bug).

Sorry, and thanks for the hint. I am not a native speaker, and had a poor English teacher at school. He knew how to remove all interest in languages. All girls were graded “excellent” and all boys were graded “so-so”, independent of anything but the gender. That time I did not know that one day I would speak 50% English at my day job, it could have changed my motivation. At least I am happy to understand enough English to participate here :smile:.

Perhaps you can post the file?

Hm, it’s a picture of my 4 years old son, and I don’t want to post pictures until he can decide by himself if it is OK. I check if I can reproduce with another image.

1 Like

I am not a dev or an experienced dt user so I can’t know for certain. Sometimes, the problem may have to do with the edges because beyond them is nothingness. With all interpolation, what to do with the void is one of the considerations that people have to make. The mirroring might be an unintended result of certain decisions made.

That was a comment on the dt manual not your English :rofl:.

In Sweden today is grammar day (not internationally?) I thought you saw a chance to legitimately set your inner grammar nerd free.

That was a good idea. At least I learned a lot by trying to reproduce. See the following example:

The upper node shows the same weird behaviour, while the lower one does not. Difference between those is that the upper arrow is much longer than the lower one.

This is with both arrows shorter:

And this one with both arrows longer:

And without liquification:

Here are the files:

DSC05235.ARW.xmp (4.6 KB)
DSC05235.ARW (19.8 MB)

I still don’t exactly understand what happens. But it seems the arrows have to stay within a certain range to work as expected. Maybe it is the same effect that causes the black hole:

Hm, I should have checked who actually wrote that sentence :wink:. That way, you had to read my boring anecdote :stuck_out_tongue_winking_eye:.

Hm, last week was international frozen food day (March 6th), and I forgot to bring a frozen pizza to work :neutral_face:. I’ll add grammar day to my list :smile:.

The strength vector should never go outside the area otherwise artifacts can appear (as you’ve experienced). Using the Liquify module to move objects out-side of the composition is not something that was plan, at least this was not designed to be used this way. So it may or may not work. I’ve always used Liquify to arrange slightly people shape or contour.

1 Like

Please, don’t get me wrong, this is a great module and I have to say “thank you” to you for taking care about it, but regarding use cases I am of different opinion.

Hm, probably it happens not only if the arrow shifts out of the image but as well if the arrow is long inside the image. See the “black hole” example above. But maybe it’s another effect.

If we only use the tools for what they are meant to be used, I guess we do not become really creative.

I have to admit that the technique is not my invention, but I learned it from some tutorial. Unfortunately I am not able to find this tutorial again. But it’s a technique that is at least used with GIMP warp and/or photoshop liquify. And, since I do not squeeze the extremities of models around but just shoot my family, getting rid of distractions is the most frequent use case for me. (I was back then almost about to shift my chin a bit in my wedding photo with GIMP warp, but then I used the original for the cards.)

Can you tell a bit about the math and why it fails at the edges? It seems not logical that it fails since only pixels from inside are pushed towards the edge.

You can look at the liquify.c for implementation if you like.

The explanation as I see it is that you have a strength vector far longer than the area itself. The pixels have to be distorted too much and then too much pixels have to be interpolated. That is, some pixels have to replace the pixels you are moving away. But at a certain threshold the number of pixel to re-synthesized are too much for the algorithm. We can probably sort of fix that by using a finer internal distortion mask but this will slow down the whole iop which is quite demanding on CPU cycle. All in all, the limitation : do not use a strength vector bigger than the area is a safe one and works in the majority of case. For heavy work on pixels the best is to move to GIMP.

1 Like

Thanks for the explanation, @Pascal_Obry! Is the threshold deterministic? That way one could limit the strength vector length. Or at least indicate a warning.

In fact I was not clear and at least there was some imprecision in my response. When the strength gets bigger than the area some pixel outside of the area gets used (when creating the internal distortion map). You can reproduce this easily, add a simple liquify circle stamp next to a separation (two color for example). When the strength vector is outside of the circle some color from outside gets copied into the center.

That’s exactly what is happening on the last picture posted. The center which is of lighter color come from the zone on the left of the two circles.

Maybe not ideal, but this behavior can be used properly in some context. Maybe a warning would be helpful.

My last English teacher was an everything -ist, not just with gender. It was such a hurtful experience that I barely passed and lost confidence in my communication skills and love for reading. I couldn’t write or speak properly for many years afterward, and I still don’t read as much as I used to and would like to. Odd thing was that her husband was everyone’s favorite. Unfortunately, I was not one of his students.

@chris’ entire desktop melted into a disturbing puddle. He laughed an empty laugh and signed into discuss.pixls (using his mobile) to find solace *ahem* an explanation.

image