Image Endpoints

GET https://api.bytestobits.dev/v1/image/mask

Mask an image.

Headers

Request Body

Example
import requests

IMAGE_PATH = "image.png"
MASK_PATH = "mask.png"
API_KEY = "YOUR_API_KEY"

response = requests.get("https://api.bytestobits.dev/v1/image/mask", headers={ "Authorization": f"Bearer {API_KEY}" }, files={
    "image": open(IMAGE_PATH, "rb"),
    "mask": open(MASK_PATH, "rb")
})

with open("out.png", "wb+") as f:
    f.write(response.content)

GET https://api.bytestobits.dev/v1/image/recolor

Swap the color of an image with another.

Headers

Request Body

Example
import requests

IMAGE_PATH = "image.png"
API_KEY = "YOUR_API_KEY"

response = requests.get("https://api.bytestobits.dev/v1/image/recolor?from_color=000000&to_color=ffffff&strength=32", headers={ "Authorization": f"Bearer {API_KEY}" }, files={
    "image": open(IMAGE_PATH, "rb")
})

with open("out.png", "wb+") as f:
    f.write(response.content)

GET https://api.bytestobits.dev/v1/image/resize

Resize an image.

Headers

Request Body

Example
import requests

IMAGE_PATH = "image.png"
API_KEY = "YOUR_API_KEY"

response = requests.get("https://api.bytestobits.dev/v1/image/width?width=1200&height=800", headers={ "Authorization": f"Bearer {API_KEY}" }, files={
    "image": open(IMAGE_PATH, "rb")
})

with open("out.png", "wb+") as f:
    f.write(response.content)

GET https://api.bytestobits.dev/v1/image/transparent

Remove a color from an image.

Headers

Request Body

Example
import requests

IMAGE_PATH = "image.png"
API_KEY = "YOUR_API_KEY"

response = requests.get("https://api.bytestobits.dev/v1/image/transparent?color=ff0000&strength=15", headers={ "Authorization": f"Bearer {API_KEY}" }, files={
    "image": open(IMAGE_PATH, "rb")
})

with open("out.png", "wb+") as f:
    f.write(response.content)

GET https://api.bytestobits.dev/v1/image/discord_faker

Generate a fake discord message.

Headers

Request Body

Example
import requests

AVATAR_PATH = "avatar.png"
API_KEY = "YOUR_API_KEY"

response = requests.get("https://api.bytestobits.dev/v1/image/discord_faker?username=Nemika&text=Hello&user_color=eccfee&date=Today+at+02%3A32+PM", headers={ "Authorization": f"Bearer {API_KEY}" }, files={
    "avatar": open(AVATAR_PATH, "rb")
})

with open("out.png", "wb+") as f:
    f.write(response.content)

GET https://api.bytestobits.dev/v1/image/dominant

Get the dominant color of an image.

Headers

Request Body

Example
import requests

IMAGE_PATH = "image.png"
API_KEY = "YOUR_API_KEY"

response = requests.get("https://api.bytestobits.dev/v1/image/dominant", headers={ "Authorization": f"Bearer {API_KEY}" }, files={
    "image": open(IMAGE_PATH, "rb")
})

print(response.json())

Image Filters

GET https://api.bytestobits.dev/v1/image/filter/blackwhite

Turn an image into black and white.

Headers

Request Body

Example
import requests

IMAGE_PATH = "image.png"
API_KEY = "YOUR_API_KEY"

response = requests.get("https://api.bytestobits.dev/v1/image/filter/blackwhite", headers={ "Authorization": f"Bearer {API_KEY}" }, files={
    "image": open(IMAGE_PATH, "rb")
})

with open("out.png", "wb+") as f:
    f.write(response.content)

GET https://api.bytestobits.dev/v1/image/filter/enhance

Enhance an image.

Headers

Request Body

Example
import requests

IMAGE_PATH = "image.png"
API_KEY = "YOUR_API_KEY"

response = requests.get("https://api.bytestobits.dev/v1/image/filter/enhance?color=1.2", headers={ "Authorization": f"Bearer {API_KEY}" }, files={
    "image": open(IMAGE_PATH, "rb")
})

with open("out.png", "wb+") as f:
    f.write(response.content)

GET https://api.bytestobits.dev/v1/image/filter/hueshift

Hueshift an image.

Headers

Request Body

Example
import requests

IMAGE_PATH = "image.png"
API_KEY = "YOUR_API_KEY"

response = requests.get("https://api.bytestobits.dev/v1/image/filter/hueshift?deg=182", headers={ "Authorization": f"Bearer {API_KEY}" }, files={
    "image": open(IMAGE_PATH, "rb")
})

with open("out.png", "wb+") as f:
    f.write(response.content)

Last updated