Skip to content

Instantly share code, notes, and snippets.

@inian inian/split.sh
Created Jun 27, 2019

Embed
What would you like to do?
Convert image to Y, Cb, Cr components
convert image.png -colorspace YUV -sampling-factor 4:2:2 -separate \
\( -clone 0 \) \
\( -clone 1 -fill black -colorize 100% \) \
\( -clone 1 -negate \) \
\( -clone 1 \) \
image_b_temp.png
convert image_b_temp-4.png image_b_temp-5.png image_b_temp-6.png -channel RGB -combine image_b.png
convert image.png -colorspace YUV -sampling-factor 4:2:2 -separate \
\( -clone 2 \) \
\( -clone 2 -negate \) \
\( -clone 2 -fill black -colorize 100% \) \
image_r_temp.png
convert image_r_temp-3.png image_r_temp-4.png image_r_temp-5.png -channel RGB -combine image_r.png
mv image_b_temp-0.png image_y.png
rm image_b_temp*.png
rm image_r_temp*.png
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.