Skip to content

Instantly share code, notes, and snippets.

@todbot
todbot / animated_gif_player.py
Last active August 3, 2022 05:15
play a BMP list like an animated gif in CircuitPython
# animated_gif_player.py - play a BMP list like an animated gif
# Take an animated gif, convert it to a list of numbered BMP files.
# For instance, with ImageMagick you can do this with:
# convert anim.gif -coalesce -resize 120x120 BMP:anim-%03d.bmp
# This creates a set of 120x120 BMP named "anim-000.bmp", "anim-001.bmp"
# Copy all these files to your "ani_dir" as set below, say with:
# cp anim*bmp /Volumes/CIRCUITPY/ani
# 17 Jul 2021 - @todbot
import time, board
import os
@edumucelli
edumucelli / client.py
Created May 9, 2018 21:25 — forked from kylehounslow/client.py
Send and receive images using Flask, Numpy and OpenCV
import requests
import json
import cv2
addr = 'http://localhost:5000'
test_url = addr + '/api/test'
# prepare headers for http request
content_type = 'image/jpeg'
headers = {'content-type': content_type}