I used to get great quality GIFs from Peek but now they're really poor:

The image is messed up, and the animation is speeded up too.
I'm using Peek 1.0.0 on Ubuntu Gnome 16.10. In Peek settings I have output format GIF, framerate 30, resolution downsampling 1.
Anything I can do to improve the quality?
Can you give a screenshot of this area you recorded? My guess is that this short recording just had too many colors and this is the best palette ImageMagick could come up with. Does recording a different area make any differences?
Also please try starting Peek with peek --backend=ffmpeg and see if this changes the quality.
Some general recommendations for recording GIFs are in the FAQs at https://github.com/phw/peek#why-are-the-gif-files-so-big
Here's a screenshot of the web page I was recording:

I don't think it's the colours of the web page or app, for example here's a recording of a different page in a different browser, same issue:

Here's a recording made with peek --backend=ffmpeg, I think you can still see the same colour issue but it's much less bad, and the speeding up seems to be gone:

I tried the avconv backend too, results look similar to ffmpeg.
Thanks for the link
This is likely due to the fact that the gnome-shell backend currently works on a lossy encoded source video, and lossy encoding often leads to more colors. I will try to change that to record the raw RGB data before converting to GIF.
What is a bit strange is that I cannot reproduce this at all (and I use the gnome-shell backend all the time). What version of Gnome Shell is that?
And could also try recording the very same screen as WebM and post the result here?
Following the advice on the page you linked, if I set my framerate from 30 (which I had set it to) down to 15 and use the ffmpeg backend then I can get a GIF output with no visible problems:

Here's a webm video as requested (github won't let me upload it): https://www.dropbox.com/s/6h0mhl4q8vzwe3h/Peek%202017-03-22%2012-15.webm?dl=0
This was with the framerate set back up to 30 (so you can compare it to the early, problematic videos above) and with the default backend (no --backend arg passed to peek). Looks perfect.
I just double-checked that _even with the framerate reduced to 15_ the GIF output with the default backend is still very bad. To get a good GIF I need framerate down to 15 _and_ ffmpeg backend. So that's what I'll do for now
I checked in a change I hope will help, recording to MP4 as intermediate format for GIF creation. Unfortunately I still cannot reproduce this myself. Can you try the latest version from the daily PPA at https://code.launchpad.net/~peek-developers/+recipe/peek-daily ? Should be updated in a few minutes.
Still need a different solution, as the x264 codec is part of gstreamer ugly plugins and I don't want to hard depend on those for the core functionality.
Hi, I installed the daily PPA to try and test this for you but ran into another issue: https://github.com/phw/peek/issues/133
Has this been resolved? I'm also having a problem with poor gif quality. My gifs are turning out grainy in some place and with green spots in others.

@spasarok That's unrelated and something I cannot do much about. The GIF format is limited to 256 colors. If the image has more colors the colors might get substituted by similar colors or dithering might be applied. Color gradients, such as in the colored areas in your example, are really bad. In your case the green colors are added to the color palette, and reused in dithering for the greyish part on the left.
Try recording a scene with less colors or use a proper video format for output (WebM or MP4).
Makes sense, thanks for the response.
gnome-shell backend now also uses raw video as source for GIFs. I close this as fixed, please let me know if it still happens with latest master (will do a release soon).
Most helpful comment
@spasarok That's unrelated and something I cannot do much about. The GIF format is limited to 256 colors. If the image has more colors the colors might get substituted by similar colors or dithering might be applied. Color gradients, such as in the colored areas in your example, are really bad. In your case the green colors are added to the color palette, and reused in dithering for the greyish part on the left.
Try recording a scene with less colors or use a proper video format for output (WebM or MP4).