How do I make Images assigned to UI Widgets default to their original size?

I’m on 5.2 and following a tutorial on UI Widgets. When the instructor assigns an Image to a widget, it comes in at whatever the Image’s default dimensions are.

But my images always default to 32x32 pixels, and I have to manually check the original size on the file and assign them to the image’s X and Y properties myself. I would like not to have to do this every time.

(This is not just “Image” widgets, but anything that can take an Image as a property, e.g. a Button).

I did a search in Editor Preferences and found this.

image

So while this explains why every image defaults to 32x32, I can’t find a setting anywhere that will allow me to override this? Does anybody know how?

(clicking “reset to default value” next to the image dimensions doesn’t do anything btw, regardless of whether it’s still at 32px, or if I’ve already changed it).

1 Like

Yeah, I’ve noticed this too. I’ve never seen any option to set the original size. You could add nodes to set it though.

I tried it out.

Image Icon is my Image widget. Just replace it with your own. And make sure to cast to the correct texture type. If you’re using a RenderTexture, cast it to a TextureRenderTarget2D.

There’s apparently an easier way. There’s a node called “Set Brush from Texture” that has a checkbox to match the size of the texture. But this destroys any other settings in the brush if you were to need those.

Are you saying you’re not experiencing this very behaviour when assigning an asset to an image?

But this destroys any other settings in the brush if you were to need those.

You can explicitly set brush size:

image

You can also pre make entire brushes in the context browser.

Setting the image has never set the “Image Size” property for me. This goes back to early versions of UE4 when I starting using UE.

1 Like

I’ve never seen it not work in UE4, interestingly enough. There is some confusion regarding what is reported as Desired Size - that’d be the parent slot interfering in most cases.

I dragged the image. I hit the little arrow. Size always stays at 32x32. I have never seen it change on its own during the last several years of using UE.

The image is 289x286 BTW.

1 Like

Yeah, this does not seem OK at all. I never even think about it because it has always worked for me - UE4.

If you don’t mind:

  • if you now stretch the image manually in the canvas, will it appear blurry as if it actually was 32x32?!

  • if you flag the canvas slot as Size To Content, will it became a tiny 32x32 in the designer? It’s now 100x30 most likely.

  • does this affect all images, even the ones from the engine?

  • how is this for your own image:


I looked at the bug DB but I see no public issues related to this. It might as well has yet to be reported. There was some regression in UE5.

  • No. It is sharp. The image has LOD’s. I removed LOD’s and still looks high resolution.
  • Size to content appears on children of canvas. So I turned that checkbox on in the Image widget and it does resize to 32x32. This has been standard. I’ve used this feature a lot to size image widgets. If it’s not correct behavior, then I’ve got to redo a lot of work.
  • Are you talking about Textures used in the Image or pre-existing images? I’ve never seen it not do this. I tried some textures from Engine assets. Same behavior.
  • I already mentioned my image is 289x286.

image

1 Like

About reporting this, I’m not sure it’s worth it. It’s annoying at worst and most of my bug reports go unanswered or those that do are cancelled for not being important enough. I think I have at least 3 so far I’m waiting on. One of them is extremely severe. My favorite is that multiplication in Dual Quaternions is wrong. I have a pull request for that one. I even wrote a full suite of unit tests for all the Dual Quaternion methods. Still nothing.

And I’m not blaming them. I know they get more requests than they can handle, but that’s kind of the point I’m making here.

Oh, and I’m still not convinced it’s not expected behavior.

1 Like

So there’s nothing wrong with the image per se; it’s the way the slot utterly ignores resource size on assign. This behaviour would be fine when working with a UI material (since there’s no innate size, we must rely on default size). Quite a few things rely on image size, though :expressionless:

IMHO, this is a serious(ish), regressed bug unless UE5 has a magical hidden switch somewhere.

I already mentioned my image is 289x286.

I was merely thinking that importing messes things up somehow but that’s not the case.

1 Like

OP here,

Are you saying you’re not experiencing this very behaviour when assigning an asset to an image?

Correct, what is shown in your .gif does not occur for me. It will resize the image in the viewport to 32x32 instead.

  • if you now stretch the image manually in the canvas, will it appear blurry as if it actually was 32x32?!

Nope no blurriness, behaves as if it understands the original resolution

  • if you flag the canvas slot as Size To Content, will it became a tiny 32x32 in the designer? It’s now 100x30 most likely.

Yes, shrinks to 32x32 when I check Size To Content.

After I manually set new dimensions, Size To Content will match it to those dimensions (meaning, it never reverts those values back to 32x32 once I’ve overridden them at least one time).

If I then drop another new (so, second) image on that slot, while Size to Content is still true, it resizes the new image to whatever the previous one was set at. As I am writing this, it is making me realize that is probably also not expected behavior? Since shouldn’t it be sizing the image to its original dimensions even in this case too?

  • does this affect all images, even the ones from the engine?

Yes, engine assets and those obtained from the asset store are what I’ve used so far.

  • how is this for your own image:

The Format number on the random ones I checked is the same as your screencap

Outside of this I haven’t seen anything to indicate it causes problems down the line with display or scripting, so at least for my part I mainly consider it an issue/annoyance in terms of workflow efficiency, FWIW.

1 Like

Bumping this thread to say that I’m experiencing the same issue with Unreal Engine 5.2.1. Images used to automatically resize when added to canvas, now they stay at 32x32 resolution. Wrapping in a scale box doesn’t fix issue either. Very annoying bug…

2 Likes

Is there any update on this situation? How are you all handling this?
My image is wrapped in a scale box + size image, and when I update it with another image of different resolution, it stretches. 4.27 would handle this nicely.

No updates on my end, have not found a solution yet, but it is at least good to know that I’m not the only one! Which hopefully will get this issue more visibility at some point.

something so simple in UE4 has become a nightmare in UE5…insane

I can’t seem to find that node ‘set vector 2D struct’. How did you get there, please?

Variables can be:

1 Like

Any updates on this?

this is my solution, in EventPreConstruct, make and set brush for image manually, ensure pins like Width or Height <= 0, it will work