How to use Texture2D.GetPixel() without Read/Write enabled?

Hi guys,

How can I use Texture2D.GetPixel() without having to enable Read/Write?

I am also open to alternatives to that function! I was trying to use Bitmap.GetPixel(), but it’s not available because System.Drawing.DLL is not included in Unity (for some reason).

Any ideas?

Thanks in advance!

What exactly are you trying to accomplish? In my experience, render textures are much faster and better than Set/GetPixel.

I am trying to read image’s pixel data. E.g, check whether the pixel at coordinates 0, 200 is of color red or not.

GetPixel() works flawlessly, however, I can’t use it because some of my textures’ Read/Write is disabled.

As in RenderTexture?

What is stopping you from enabling read/write on those textures?

I am working on a program that looks up for ALL textures and checks their pixel data. Enabling read/write everytime the script runs would seem like a waste of time.

All textures where? The editor? At runtime? Some external folder?

Without further explanation of what you are trying to accomplish, I still don’t see any reason not to use GetPixel as intended.

In editor.

If you need further explanation let me know.