VideoHelp Forum




+ Reply to Thread
Results 1 to 5 of 5
  1. Member
    Join Date
    Mar 2008
    Location
    United States
    Search Comp PM
    I can’t seem to figure out why this is happening. I have a transparent png overlay on video and the overlay looks really bad. The red shapes are blurry on the edge. I’m using the same code I have in the past so I’m not sure why this is happening now.

    This is what it look like.
    http://mo-de.net/d/wtf.jpg

    The png file.
    http://mo-de.net/d/1.png

    This is the code.

    #Start trimming Audio
    main_explanation=WAVSource("C:\projects\video_edit ing\projects\howto\AY_Repetitive_I\acrobaticyoga_R epetitive_I_6\acrobaticyoga_Repetitive_I_6.wav")

    at1=AudioDub( BlankClip(a, audio_rate=44100, Ceil (main_explanation.AudioLengthF()/main_explanation.AudioRate()*a.FrameRate())) , main_explanation)
    at1=at1.trim ((3+0)*30,(25+0)*30).KillVideo()
    #End trimming Audio

    overlay_explain_1_image=ImageReader("C:\projects\v ideo_editing\projects\howto\AY_Repetitive_I\acroba ticyoga_Repetitive_I_6\1.png",pixel_type="RGB32")

    lex_explain_overlay_1=atrim1.trim((10+0)*30+10,(10 +0)*30+10).killAudio().loop(Ceil (at1.AudioLengthF()/at1.AudioRate()*a.FrameRate()) ).overlay (overlay_explain_1_image, mode="blend", mask=overlay_explain_1_image.ShowAlpha(pixel_type= "RGB32") , x=0, y=0, opacity=0.30)
    lex_explain_overlay_1=AudioDub(lex_explain_overlay _1, at1)

    center_overlay=ImageReader("C:\projects\video_edit ing\projects\howto\AY_Repetitive_I\acrobaticyoga_R epetitive_I_6\9.png",pixel_type="RGB32")
    center_line=AudioDub(LexExplain.trim((2*60+4)*30,( 3*60+0)*30), at9)
    \.overlay (center_overlay, mode="blend", mask=center_overlay.ShowAlpha(pixel_type="RGB32") , x=0, y=0, opacity=0.30).Amplify(2)

    overlay_all_together= lex_explain_overlay_1++center_line.ConvertToRGB32 ()
    Quote Quote  
  2. I suspect what you are seeing is just the result of 4:2:0 chroma subsampling (colored edges will always be a little fuzzy in YV12).
    Last edited by jagabo; 15th Aug 2010 at 07:35.
    Quote Quote  
  3. Member
    Join Date
    Mar 2008
    Location
    United States
    Search Comp PM
    How do I fix it?
    Quote Quote  
  4. Are you seeing those artifacts before compression or after? Here's what I see using Overlay() and the overlay image shifted to the left by 200 pixels.

    src=ImageSource("wtf.jpg").ConvertToRGB32()
    over=ImageSource("1.png", pixel_type="RGB32")
    alpha=ShowAlpha(over)
    Overlay(src, over, mask=alpha, x=-200, y=0, opacity=0.30, mode="blend")
    working in RGB:
    Click image for larger version

Name:	444.png
Views:	478
Size:	273.7 KB
ID:	3105

    after converting to YV12 (4:2:0 chroma subsampling):
    Click image for larger version

Name:	420.png
Views:	439
Size:	284.9 KB
ID:	3106

    The second image was made by adding ConvertToYV12() at the end of the script. All high compression codecs work in YV12. What you're seeing is worse than just 4:2:0 chroma subsampling.
    Last edited by jagabo; 15th Aug 2010 at 17:26.
    Quote Quote  
  5. Member
    Join Date
    Mar 2008
    Location
    United States
    Search Comp PM
    Jagabo, that looks better. I will try this and see what happens. Thanks

    [Edit]
    [ Solved Solution ]

    As jgabo said and it works I converted all the movies to this color space and everything looks great ".ConvertToYV12()"
    Last edited by lindylex; 15th Aug 2010 at 23:23.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!