It’s kind of hard to explain but I’ll try my best. I was trying to precisely move a layer by one pixel using the “Move a layer (T)” tool while getting reference from the dimensions section of the layer properties pop-up window for that layer.
But for some reason, every time I tried to move the layer, the layer directly underneath(that I was trying to match the upper layer with) would also end up moving by one pixel, but in the opposite direction I believe.
Thinking I was going crazy, I kept trying and trying until I finally decided to try locking the lower layer and that seemed to do the trick. I feel like that’s got to be a bug though.
No, I’ve never even used masks as I just found out they were a thing about a few weeks ago.
I think I see what you’re talking about (in the tool options docker). But I don’t think I ever messed with those settings and “Move current layer” is currently selected so it was probably that way when I had the problem too.
I’ve seen that happen (and correctly) when you clone a layer, add a transform mask to it and mirror it, then move the source layer.
It wouldn’t be prevented by locking the clone and you said you’re not using masks though, so I’m at a loss at what could be happening. Add more details about layer types involved and what exactly you did before it happened so we try to reproduce.
I was on a 2846x1622px (300ppi) canvas. I had an image covering the entire canvas on the bottom-most layer. (Let’s call it Layer 0.) Above that layer, I imported a perfectly square (4000x4000px) artwork that I designed in Krita. (Let’s call this import Layer 1.) Once imported, it started in the middle of the canvas and I immediately went to Layer > Transform > Scale Layer to new Size. I then proceeded to scale Layer 1 to 363x363px. After successfully scaling it, I dragged it to where it needed to be by using the “Transform a layer or a selection” tool.
Next, above Layer 1, I once again imported what is basically a copy of the same artwork but with a different coloration. (Let’s call this second import Layer 2.) So, like Layer 1, Layer 2 started off in the middle of the canvas. I scaled it to 363x363px and then dragged it over as close as I could get it using the “Transform a layer or a selection” tool. But this time, I wanted Layer 2 to stack on top of Layer 1’s position perfectly. With Layer 1 already in place, I just needed to move Layer 2 by a small amount of pixels to align it correctly. And so I swapped to the “Move a layer” tool to more precisely move it the rest of the way. It took me a few tries to finally get it 1 pixel away. (I constantly looked at the coordinates of both layers in the layer properties pop-up menu to see how close I had gotten after each movement.)
Finally, Layer 2 was now 1 pixel away from matching the coordinates of Layer 1. So I did again what I had already been doing. I used the “Move a layer” tool to move Layer 2 by 1 pixel (in hopes of finally aligning it with Layer 1). It should have been done at this point, but when I went to check the coordinates of Layer 1, it had somehow also moved by 1 pixel. This meant, that while Layer 2 was where it should have needed to be, it was now still 1 pixel off. So I clicked on Layer 1, and I moved it back by 1 pixel (trying to undo the weird change). And when I compared both of the coordinates again, Layer 2 had magically also shifted back by 1 pixel which essentially just put me back to the beginning. (Only one layer was selected at a time.)
In case of confusion, this is how the layers were stacked up:
Layer 2 - Imported (and Scaled) Artwork #2
Layer 1 - Imported (and Scaled) Artwork #1
Layer 0 - Original (Canvas Covering) Image
Side Notes:
I have since thought of using transparency on the upper layer to visually see them line up so I don’t even need the coordinates at all. But I thought I’d still post this in case it really is a bug that could be fixed and benefit somebody.
I’m also going based on my memory of how it happened. I’m pretty sure that’s what I did and what happened. I wasn’t even sure if it was significant enough to be worth reporting so I waited on it for a while before ultimately deciding to post it anyways.
This is pure conjecture, I’d have to try it later, but:
Getting an exact pixel size by hand is challenging, and the scale option at the docker isn’t your friend in this case because it only works for round % numbers and the closest, 11%, yields 636.63636363(…) px.
Meaning Krita won’t know what do with that fraction. Afaik it is possible to have fraction of pixels, and where and if they’re rendered depends on the layer position.
It could be that it isn’t the act of moving the other layer that’s triggering the issue, but finishing the action of moving by changing tools, so Krita updates the layer size, the canvas, and now the layer is left enough the pixel is rendered, it counts for position. You correct it, now it isn’t, the position changes again after once you’re done, and it goes on.
I’ll try to reproduce this later today.
Related tips
You can move layers by a pixel using the transform tool + keyboard arrows.
There’s also a docker, Arrange, with which you can align layers. Not paint or file layers (I’m not sure how you imported your images), but I wrote a plugin that can arrange those and do a bit more.
Assuming you’re talking about the transform tool in the Toolbox docker, no I didn’t. I hovered my mouse near the top of the screen to interact with the UI, where I hovered it over Layer, then moved my mouse down to Transform, and finally across and down to Scale Layer to new Size. That lets me enter an exact final size as opposed to manually rescaling.
Whether you’re talking about the transform tool in the Toolbox docker, or exactly the process that I did, both imported images started off perfectly square and at the same exact size, and both were scaled in exactly the same way and to the same exact final size. So I don’t think there should be any size variation nor any difference in behavior between them.
Even if they were both a weird size like 636.63636363 px, I imagine they would probably both still act in the same irregular way due to being identical.
This is a good theory…but being the same exact size, they should still both change positions to the same final spot. I did manage to get them to line up perfectly eventually and without altering their dimensions at all so they have to have been the same size.
And to be more clear, I created a new design on a 4000x4000px canvas. Then I gave it a solid background color on a layer underneath. Then I gave it a second background color on another layer underneath. Then I saved both design+background color combinations as separate .png files. Finally, I imported those two .png images onto the new canvas I made.
This new canvas is just a mockup photo I made for Instagram profile picture changing. I just took a cropped screenshot of Instagram and opened it in Krita(hence the weird canvas size) and used it for the background while I imported my two .png files to lay over the older profile picture.