How to detect empty sprite frames in script?

Hi,
to simplify the sprite import and setup for multiple sprite sheets I import my spritesheets by c# script. This works so far, but I could not find a way to ignore empty cells the way is is done in the sprite editor.

Any idea how this can be done in script?

I think you’d have to read all the pixels within the proposed area and decide if there are any of them “solid enough” that you want to create a sprite.