Getting random color pixels from Texture2D

Hey, I did the same thing as you did, exactly the same, but my editor keeps crashing. Any idea why that might be happening? could you tell me how did you call this function, and what are your image import settings?