Jagged edges in HTML graphics

I am experiencing jagged edges in CasparCG HTML graphics. This issue is only present in CasparCG and does not occur when using the same HTML page in Chrome browser, vMix v26, and the latest OBS.

server: CasparCG 2.4 RC1
system: windows 10

<!DOCTYPE html>
  <style type="text/css">
      background: black;
    #box {
      position: absolute;
      top: 20%;
      left: 20%;
      width: 50%;
      height: 50%;
      background: linear-gradient(-45deg, #7A0000, #C20000, #DE3F3F);
      border-block: 6px solid whitesmoke; 
      transform: perspective(700px) rotateY(-6deg);
  <div id="box" />

this is the output from vMix with same html

adding outline: 2px solid transparent; to html making it smooth in CasparCG server.

but something is still not smooth as this is the output from cg server to vmix via ndi.

What is your casparcg.config file look like? That can be very telling.

Does it look any better/different if you set angle-backend to d3d11? server/src/shell/casparcg.config at a6fdb6a5a54cfa4ee4790e3c738d8d4853dc18eb · CasparCG/server · GitHub

Could OBS /VMix be injecting some CSS/JS to enable some antialiasing?
It looking different in caspar to vmix via ndi is strange, unless vmix or ndi is messing with the frames in some way

        <log-path disable="false">log/</log-path>

Tested it with d3d11 but it’s not doing anything with aliasing/jagged edges.

i think vmix is doing something with the frames as below is the output from CasparCG to media express via decklink output

Is the difference because CasparCG is running interlaced and VMix is running progressive?

Your problem is in the config.
I see you are using PAL and that’s SD resolution.
Try 1080p5000.

don’t know what are they doing. maybe they are using different subsampling.

Jagged edges in HTML are more about antialiasing than resolution.
Adding outline: 2px solid transparent; is a handy workaround to trigger antialiasing and get those smooth edges back.

here is the output of 1080p5000 without outline css.

1 Like

Had this trouble, turned on text smoothing in Windows and it fixed it.