I have written a JPEG, GIF, and PNG decoder. All easily weekend projects. As for the other two I've attempted the same for:
JPEG2000: insanely complex and nonintuitive, especially the edge-cases and overly flexible encoding decisions
WebP: also complex, and effectively Google-proprietary