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 best solutions below
Related Questions in IMAGE
- Add image to JCheckBoxMenuItem
- Display images on Django Template Site
- How to resize images with PHP PARSE SDK
- Animation in Java on top of JPanel
- Slow performance on ipad erasing image
- What are the pros and cons of the picture element?
- Carrierwave file upload with different file types
- How to use annotorious with angular
- Images not showing when uploaded to server
- ImageView doesn't show up
- Image Resizing adjusts ratio
- Displaying bitmap image on Android (OpenCV)
- Class 'Imagick' not found - PHP and Windows
- Image position - randomly select position
- Replace image 1 with image 2 after 5 sec
Related Questions in GO
- How do I get all the attributes of an XML element using Go?
- Type cast custom types to base types
- Why are Revel optional func parameters in controller not working? CRUD code redundancy
- Streaming commands output progress
- single ampersand between 2 expressions
- golang goroutine use SSHAgent auth doesn't work well and throw some unexpect panic
- How do I do a literal *int64 in Go?
- Emulating `docker run` using the golang docker API
- How to print contents of channel without changing it
- Golang time zone parsing not returning the correct zone on ubuntu server
- Is os.File's Write() threadsafe?
- How to get the pointer of return value from function call?
- How do I represent an Optional String in Go?
- Fibonacci in Go using channels
- Boltdb-key-Value Data Store purely in Go
Related Questions in RGB
- How in vb.net can I insert a value on a read only property?
- Store all RGB values in a database
- Convert a 0-1 value to a hex colour?
- Unexpected behavior in my RGB-strip driver code
- Fragment shader does not show any colour when compiled with vs2013
- Matching Xcode color space with Digital Color Meter
- How can I know if the image is in RGB or BGR format?
- How i can set rgb color?
- Read in Bufferedimage pixel values then manipulate each one and write to file
- assign RGB values in java with nested for function
- Why does windows GDI use RGBA format for `COLORREF` instead of BGRA?
- Python skimage.feature.match_template() RGB image
- Why don't images use functions to store rgb values?
- Does RGB supports decimal values?
- Java BufferedImage
Related Questions in YUV
- Fragment shader does not show any colour when compiled with vs2013
- Will all phones support YUV 420 (Semi) Planar color format in h.264 encoder?
- Conversion from YUV420sp to RGB in python
- is the audio source for .yuv test video sequences available?
- Convert yuv to bitmap failed in MediaCodec
- Android camera2 jpeg framerate
- How do I rotate yuv/rgb image using libav
- Cropping rectangular area from bitmao using YuvImage produces strange result
- FFMPEG: Mapping YUV data to output buffer of decode function
- Play YUV video on Android
- FFMPEG: Dumping YUV data into AVFrame structure
- How do I create the 'byte[] yuv' parameter for YuvImage from my camera preview?
- How can i extract a yuv frame from given yuv 4:2:0 file
- Convert raw yuv to mp4 crashed on android
- Encoding yuv frames to video file in java
Related Questions in YCBCR
- How to save Ycbcr numpy array to an image without changing its array points?
- I can't get vImage (Accelerate Framework) to convert 420Yp8_Cb8_Cr8 (planar) to ARGB8888
- Python - White balance check on a YCbCr image
- OV7670: Why does the test pattern work, but the colors of a picture are wrong?
- What is the best way to display each ycbcr channel of an image separately in Python with numpy, scipy, skimage etc?
- How can i convert YCbCr to BGR24 using ImageISharp
- Finding the colour that matches one from a given palette
- Matlab: Save image frames as YCbCr video
- Increasing the Y value in a YCbCr image in Python (pillow) results desaturated image
- How can I use multiple immutable samplers in vulkan?
- Converting RGBA binary image into YCbCr but the result is not as expected
- RGB to YUV 420P image conversion in Go
- How to correctly read an image in YCbCr mode?
- YCbCr Video Input STM32F746
- How can I generate the faces of a YCbCr cube in VB.NET
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)
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?
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.