charlielee / boats-animator

Stop motion animation program created using Electron
http://charlielee.uk/boats-animator
GNU General Public License v3.0
113 stars 18 forks source link

Fix playback and capture being off by one pixel #449

Open charlielee opened 1 year ago

charlielee commented 1 year ago

It's hard to see it in these screenshots, but the playback and capture feeds seem to be different by one pixel. This is present in v0.12.0 and the rewrite code. The canvas also has a row of blurred pixels at the very bottom.

offpixelcapture offpixelplayback

I think the problem is related to how pixels are rendered on a <video> element (used for the live feed) and a <canvas> (used for playback). Some downscaling occurs when the image is shown. One simple solution could be to hide the video element and display the live feed onto a canvas.

https://stackoverflow.com/questions/4429440/html5-display-video-inside-canvas

Other options may be:

charlielee commented 9 months ago

alternatively could the canvas used for playback be shown on a video? https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/captureStream