
Unity’s UI system provides two very similar components: Image and RawImage.
The core difference is simple: Image displays Sprites, while RawImage displays Textures.
A Texture is the basic image data in Unity. It’s simply a bitmap that can be used on materials, meshes, or UI elements. A Sprite is a texture with additional metadata used by Unity’s 2D and UI systems, such as pivot information, borders, and slicing data. In practice, a sprite is a texture packaged with extra information that makes it better suited for UI workflows.
Sprites are the standard format for most UI graphics. When you import icons, buttons, or backgrounds, they are typically used as sprites. The Image component is designed around this and supports features like slicing, fill methods, and sprite atlases.
imageComponent.sprite = mySprite;
RawImage works directly with textures, which makes it ideal for dynamically loaded images (that are never converted into sprites) and content generated at runtime, such as
rawImageComponent.texture = myTexture;
For your own Unity project you are best advised to choose Image when working with sprite-based UI assets, and use RawImage when you want to display a texture directly, especially if it’s generated or managed at runtime.