There is no 'Renderer' attached to the Image game object (for UI)

Canvas Renderer != Renderer?

I have an image, trying to load a Texture2D from the web.

I tried img.GetComponent<Renderer>() img.gameObject.GetComponent<Renderer>() but both is showing nothing.

Am I doing this wrong? I found a YouTube tutorial video where they use a quad – but I thought you aren’t supposed to use quads for UI?

UI images don’t have renderes they have Image

img.GetComponent<Image>();

And they don’t support Texture2D but Sprite, so convert your downloaded texture into sprite and then apply it to your Image

img.GetComponent<Image>().sprite = YOUR CONVERTED SPRITE;

Accept if it helps