Replies: 3 comments 1 reply
-
Hello @hi5 . I apologize that it's taken me some time to respond! I think this problem could be solved (or at least improved) by giving the paint bucket cursor a "disabled" icon when it isn't positioned over a layer and "sample from layer" mode is active. This is what GIMP does, for example. Because PD doesn't currently change the tool cursor, it makes it look like a paint bucket action should work when clicking outside all layers (when "sample from layer" is selected), even though the tool won't do anything by design, because it doesn't have a layer to sample if one doesn't exist under the cursor. I'll start work on fixing this. (Sampling in this case means "taking a test sample", like you'd do at a doctor's office - the paint bucket tool needs an object to "sample" pixels from, and the source of those samples can be either the active layer, or all layers merged together to make an "image".) Longer explanation: When you expand (or contract) the image canvas, layers themselves do not change in size. If it helps, think of the canvas as an imaginary box that surrounds the layers in the image - it doesn't actually contain pixel data, it's literally just a set of four coordinates that define a bounding box. When you change canvas size, it only changes the values of that bounding box. Layers remain untouched. This is how Photoshop and GIMP work, but it is not how apps like Paint.NET work. (In Paint.NET, every layer is always the full size of the image. Changing canvas size means expanding/contracting all layers to match, because all layers - even ones only 1 px "big" - must have transparent borders added to them until they match the canvas size.) When "sample from image" is used in the paint bucket tool in PD, all layers are merged together into a temporary layer object, then that temporary layer object is expanded/contracted as necessary to fit the canvas boundaries. This becomes the object being sampled, and it's called the "image" because it represents the full image as it appears on-screen. (In the case of a single layer in an enlarged image canvas, this temporary layer will include all the transparent pixels that lie "outside" the active layer, but "within" the canvas boundaries, because they're part of the "image" but not part of the active "layer".) The paint bucket calculation is then applied to that temporary layer, then the final result is merged onto the active layer. This may result in the active layer being expanded or contracted so that it can hold the new paint bucket data. If you use the paint bucket tool in "sample from layer" mode, however, the layer size will not change, and the fill won't happen at all unless you actually click a point on the active layer. This behavior is different with a new layer because by default, a new layer is always initialized to the full size of the image. I'm sorry for how confusing this can be! For tools like the paint bucket, which require target pixels to operate on, the cursor really needs to reflect when you've asked it to do something that won't work. For example, if you see a "disabled" paint bucket cursor because you're outside the current layer, you could then resolve it by switching to "sample from image" mode, or by enlarging the layer to full canvas size via Another possibility is to simply auto-enlarge the active layer to the size of the full canvas if you try to fill outside the active layer's boundaries. Maybe that would be more intuitive? Hmm.... Either way, I'll give this some thought and get a fix implemented! Thank you for bringing it up. I hadn't realized how confusing this behavior was until I had to actually explain it 😅 |
Beta Was this translation helpful? Give feedback.
-
Thank you for your detailed answer, I now understand the "why" better. Both your suggestions would work, the "disabled" gives some user feedback so even though users still might think "why?" like I did, they at least have an indication "I need to do or learn something". But I have no preference as such. (Just do what is easier to program 😄 ) |
Beta Was this translation helpful? Give feedback.
-
The new nightly build works as advertised, thanks for the update. |
Beta Was this translation helpful? Give feedback.
-
When I have a single layer / bottom layer image which I have expanded or create(d) a transparent area in I want to fill it with color using the paint bucket.
I notice there is a difference when choosing sample from image vs layer. When the sample is image it fills it with color, but when it is layer it doesn't. That tripped me up a few times. (and I don't know what sample means here)
If you create a new empty layer in that same image you can fill that new layer with color with both image or layer.
So why isn't this the case for a single layer image? I'm not saying it is a bug, but I just don't understand it 😸
PNG image (using this image won't work as the transparent area is a screen grab, not actually transparent) but just to show the settings.
🖼 Test PDI image.zip
Version: PD 2024.4 alpha (build 5) but this has 'always' been the case in the v9 series I think so not specific to any version.
Beta Was this translation helpful? Give feedback.
All reactions