alecjacobson / computer-graphics-raster-images

Computer Graphics Assignment about Raster Images
20 stars 46 forks source link

image with width=1 or height=1 #63

Open JackC92 opened 3 years ago

JackC92 commented 3 years ago

I saw a previous issue about this, but I don't think there's anything wrong with it. Is there any convention that a valid image should have at least two rows and two columns?

amacle commented 3 years ago

Nope! A 1px by 1px image is perfectly valid

lvlingxiao1 commented 3 years ago

Then for demosaic, if there is only one row, we might not have any red/blue to average, what should the value be then? Should it be zero?

amacle commented 3 years ago

yes, the image would not be tall enough to encode/store any red channel values when applying the Bayer filter as-described, so the red values when demosaicing would be zero