feat: add dithering param and parallel frame rendering for GIF
- Add dithering bool param to GIFRequest (default true) - Parallelize frame rendering with goroutines - Conditional Floyd-Steinberg dithering for speed vs quality tradeoff
This commit is contained in:
parent
0cbbe647f9
commit
fb3c4a0107
4 changed files with 29 additions and 12 deletions
|
|
@ -103,7 +103,7 @@ func (h *Handlers) HandleGIF(w http.ResponseWriter, r *http.Request) {
|
|||
return
|
||||
}
|
||||
|
||||
gifBytes, err := render.RenderGIF(result.GLBBytes, result.Atlas, req.Background, req.Frames, req.Width, req.Height, req.Delay)
|
||||
gifBytes, err := render.RenderGIF(result.GLBBytes, result.Atlas, req.Background, req.Frames, req.Width, req.Height, req.Delay, *req.Dithering)
|
||||
if err != nil {
|
||||
writeError(w, http.StatusInternalServerError, "render failed: "+err.Error())
|
||||
return
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue