GET
https://api.bytestobits.dev/v1/image/mask
Mask an image.
Request Body
Black-white image to use as mask
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.
Request Body
The similar-shaded colors to include (Defaults: 20)
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.
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.
Request Body
The color hex to make transparent
The similar-shaded colors to include (Defaults: 20)
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.
Request Body
Color hex for the username
Date to use (such as Today at 03:52 PM)
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.
Request Body
Image to get the dominant color of
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.
Request Body
Image to remove the color from
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.
Request Body
Value to increase the intensity of the image colors (Defaults: 0)
Value to increase the brightness of the image (Defaults: 0)
Value to increase the sharpness of the image colors (Defaults: 0)
Value to increase the contrast of the image (Defaults: 0)
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.
Request Body
Degrees to rotate the hue of the image (Defaults: 20)
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)