View Full Version : Resizing Pure Luma Without Conversion
SMurf
28th January 2013, 22:59
Hello,
I'm not sure which sub-forum this would fit in, so I'm posting it here.
If I have a pure luma (Y) stream of a particular resolution (I can split it into individual frames if need be), is there any software out that will allow me to resize the frames without converting to/from RGB?
Bonus point for something that uses a high quality algorithm (splines?) :cool:
paradoxical
28th January 2013, 23:01
Does Avisynth not allow you to do that?
SMurf
28th January 2013, 23:15
Hmmm. It does support an ImageSource with pixel_type=Y8, but it's not clear whether that is luma or not (says "8-bit grayscale" in the manual) :confused:
Edit: Thinking about this... Y is 8-bit values range 16-235... if I tell a program that it's normal RGB grayscale, and get it to do high quality resize with gray samples, then export raw... that would do it, yes?
J_Darnley
28th January 2013, 23:39
Luma is greyscale (what is confusing about this?) so you could use avisynth. Another option is ffmpeg.
SMurf
28th January 2013, 23:50
Luma is greyscale (what is confusing about this?)
Lots of programs think grayscale is R = G = B.
Luma is 0.299 R + 0.587 G + 0.114 B.
Hence confusion. ;)
Asmodian
29th January 2013, 00:11
Avisynth 2.6 has the Y8 color space which it sounds like is exactly what you want.
SMurf
31st January 2013, 01:38
Avisynth doesn't seem to want to accept raw YUV frames, so I'm looking at the ffmpeg route.
I'm trying:-
ffmpeg -pix_fmt gray -s 704x576 -i frame2217.y -s 752x576 out.yuv
The output looks OK, but analysing the histogram shows that some pixels have luma values out of range (16-235).
Is there a way of intimating to ffmpeg that the input luma is TV scale, and the output should be too?
Asmodian
31st January 2013, 02:10
Avisynth doesn't seem to want to accept raw YUV frames, so I'm looking at the ffmpeg route.
http://avisynth.org/mediawiki/FAQ_loading_clips#How_do_I_load_raw_source_video_files_into_AviSynth.3F
carla2013
13th February 2013, 15:51
Lots of programs think grayscale is R = G = B.
Luma is 0.299 R + 0.587 G + 0.114 B.
Hence confusion. ;)
You are so right
nevcairiel
14th February 2013, 12:08
Lots of programs think grayscale is R = G = B.
Luma is 0.299 R + 0.587 G + 0.114 B.
Hence confusion. ;)
But it is. Anything else would get a colored tint.
If you assume it is, and then insert that into your equation there, the result is interesting.
R = G = B
Y = 0.299 R + 0.587 G + 0.114 B
R = G = B, subsitute all G/B with R, because they are equal
Y = 0.299 R + 0.587 R + 0.114 R
Y = R * (0.299 + 0.587 + 0.114)
Y = R * 1
Y = R = G = B
Easy math. ;)
Chroma isn't present, and the Luma alone defines the value of R/G/B
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.