I am wondering, how can I perform conversion from RGB to YUV 420P image in Go (more precisely *image.RGBA to *image.YcbCr). I havn't found any standard method in image package for that. As I also didn't find any library for that, my only idea was to make it pixel by pixel using color.RGBToYCbCr(), but I realised that *image.YcbCr hasn't Set() method for working directly on pixels, so I'm a bit confused. I would be gratuful for some directions or code for that.
Greetings
RGB to YUV 420P image conversion in Go
1.3k views Asked by MikolajMGT At
1
There are 1 answers
Related Questions in IMAGE
- Golang lambda upload image into s3 static website
- Put an image behind the title in a WP, WooCommerce "shop" page
- How to create an JSOUP element from byte array image (Load from Database)
- Cloudflare not respecting Cache-Control
- Sending multiple images and data in a single angular observable
- Create and combine several images into a single image for my react native App
- Should I compress images in java backend before sending to frontend?
- Javascript Place Image Where User Clicks
- Whitespace in document has a bottom border remnant or some other line at the bottom of the whitespace
- Sony Spresense Camera Board
- After completely installation and done all the work i am getting Permission denied error do any one have solution
- HTML page on NAS server image not showing on mobile phone
- mouse coordinates in image go below 0 and above width
- Why are the css images or js not loading in my laravel project?
- Python pillow library text align center
Related Questions in GO
- Go Fiber and HTMX - HX-Trigger header is changed to Hx-Trigger, which is not what HTMX is listening for
- Golang == Error: OCI runtime create failed: unable to start container process: exec: "./bin": stat ./bin: no such file or directory: unknown
- Handling both JSON and form values in POST request body with unknown values in Golang
- invalid transaction: Transaction failed to sanitize accounts offsets correctly
- Golang lambda upload image into s3 static website
- Is there a way to get a list of selected module versions, but only for modules within the pruned graph?
- Save Interface in DB golang
- ERROR: column "country" is of type text[] but expression is of type record (SQLSTATE 42804)
- Trying to update the version.go file with the release tag from GitHub actions but its failing
- How can I optimize this transposition table for connect 4 AI?
- const declaration - How to evaluate expressions at compile time?
- How add array of authors for unique user in database in Goland IDE?
- Why is the main goroutine not blocked after write in unbuffered channel?
- Insert & Retrieve from a channel in same main function throws "goroutine 1 [chan receive]: main.main() /path exit status 2" error
- Gob error when decoding array of structs: decoding into local type but received remote type
Related Questions in RGB
- How do I modify this intrinsics code going from YUV420 to RGB24 to output RGBA32
- What is the size difference between Convolutional Neural Networks that take as input an RGB vs. monochrome image?
- Do decimal values affect color channels in CSS?
- Python converting an sRGB value to RGB
- RAW10 to RGB888 conversion
- How many colors in YCbCr JPEG under common conditions 3x8bits?
- Python: grayscale image to RGB image with provided palette
- Kornia outputs only white images
- How do I change my code to fill an excel spreadsheet with colour?
- Converting Front Hand View to Back Hand View or vice versa Using Python
- Patching a PIL image in pytorch tensor and convert back
- Plot camera sensitivity-wavelength distribution based on RGB image
- Trouble changing background of input textbox
- how do I convert a large array of rgb values to a hex array
- Conflicting LAB Results from RGB
Related Questions in YUV
- How do I modify this intrinsics code going from YUV420 to RGB24 to output RGBA32
- Retrieving VUI after AVC/HEVC decoding from *.yuv file?
- Convert a YUVJ422 and YUVJ420 frame into YV12 in C++ with FFmpeg
- How to convert 8-bit YUV420 image to RGB with Neon?
- Android Camera2 combine burst capture images from camera with shorter maximum exposure time to emulate long exposure times
- How can I convert a Bitmap to YUV420 in Android?
- how to use the the function "ARGBToNV12" in libyuv
- Bad src image ptrs converting YUV to RGB after H264 decoding with libav and c++
- Fastest way to extract raw Y' plane data from Y'Cb'Cr encoded video?
- How to render YUV video when height is greater than width?
- Why FFmpeg transcode with strips
- Flutter - Convert YUV to RGB
- How to convert a Flutter CameraImage from a startImageStream() to PNG, JPG or Base64 String, REALLY FAST?
- Using the dav1d framework, rendering on iOS
- How about android ndk AMediaCodec decoding data saved as yuv I420 file?
Related Questions in YCBCR
- What is the correct way to convert a YCBCR_420_888 image to RAW10 format?
- How many colors in YCbCr JPEG under common conditions 3x8bits?
- How can i convert YCbCr to BGR24 using ImageISharp
- Increasing the Y value in a YCbCr image in Python (pillow) results desaturated image
- Python - White balance check on a YCbCr image
- Converting RGBA binary image into YCbCr but the result is not as expected
- What is the best way to display each ycbcr channel of an image separately in Python with numpy, scipy, skimage etc?
- OV7670: Why does the test pattern work, but the colors of a picture are wrong?
- Matlab: Save image frames as YCbCr video
- I can't get vImage (Accelerate Framework) to convert 420Yp8_Cb8_Cr8 (planar) to ARGB8888
- How to save Ycbcr numpy array to an image without changing its array points?
- Finding the colour that matches one from a given palette
- Why converting BGR to YCbCr in OpenCV inherit different value compared to manually counting it using equation?
- How to correctly read an image in YCbCr mode?
- RGB to YUV 420P image conversion in Go
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Popular Tags
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
You could use
image.NewYCbCr()to create an instance ofimage.YCbCrwhose pixels you can directly manipulate. Then it is just a matter of usingcolor.RGBToYCbCr()for each pixel in the image:In the snippet above
originalis a regularimage.RGBAandconvertedisimage.YCbCr. See that the corresponding positionposin the arrays of the color components ofconvertedis computed from the pixel coordinates inoriginal.