You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can’t set the pixels of an image.YCbCr (i.e. a JPEG image) directly, because the underlying data doesn’t map 1:1 to pixels, due to chroma sub-sampling. If you know what you’re doing, and are aware that setting one Chroma sample can affect multiple pixels, then the image.YCbCr struct exposes enough to let you set pixels. But if you don’t know what you’re doing, then we figured it’d be less dangerous to disallow behavior (setting pixels) than have potentially surprising behavior.
In general, work in RGBA as long as you can. The jpeg Encoder converts to YCbCr just before writing bits on the wire, but the intention is that you draw on your RGBA and pass your RGBA to jpeg.Encode.
This means that is not usable out of the box with the
image/draw
package. Is this an oversight, or is there a particular reason for the omission?/cc @nigeltao
The text was updated successfully, but these errors were encountered: