Apply Sepia
Apply a warm, vintage sepia tone effect to images.
POST
/api/image/sepia
Request Parameters
Parameter | Type | Required | Description |
---|---|---|---|
file | File | Yes | The image file to process. Supported formats: JPEG, PNG, WebP, BMP, TIFF. |
Response
Returns the image with the sepia effect applied, in the same format as the input file.
Example Request
curl -X POST "https://oyyi.xyz/api/image/sepia" -H "accept: application/json" \
-H "Content-Type: multipart/form-data" \
-F "file=@image.jpg" \
--output sepia.jpg
Example with Python
import requests
url = "https://oyyi.xyz/api/image/sepia"
files = {
'file': open('image.jpg', 'rb')
}
data = {}
response = requests.post(url, files=files, data=data)
# Save the processed image
with open('sepia.jpg', 'wb') as f:
f.write(response.content)
Example with JavaScript
// Using fetch API
const formData = new FormData();
formData.append('file', fileInput.files[0]);
fetch('https://oyyi.xyz/api/image/sepia', {
method: 'POST',
body: formData
})
.then(response => response.blob())
.then(blob => {
// Create a URL for the blob
const url = URL.createObjectURL(blob);
// Create a link to download the image
const a = document.createElement('a');
a.href = url;
a.download = 'sepia.jpg';
a.click();
// Clean up by revoking the URL
URL.revokeObjectURL(url);
})
.catch(error => console.error('Error:', error));
Intensity Settings
Low Intensity (0.1-0.5)
Subtle sepia effect, slight warming of the image
Medium Intensity (0.6-1.2)
Classic sepia tone, good for vintage photos
High Intensity (1.3-2.0)
Strong sepia effect, dramatic vintage look
How It Works
The sepia effect is created by applying a specific color transformation to each pixel in the image. The transformation matrix used is:
[ 0.393 + 0.607 * (1 - intensity), 0.769 - 0.769 * intensity, 0.189 - 0.189 * intensity ]
[ 0.349 - 0.349 * intensity, 0.686 + 0.314 * (1 - intensity), 0.168 - 0.168 * intensity ]
[ 0.272 - 0.272 * intensity, 0.534 - 0.534 * intensity, 0.131 + 0.869 * (1 - intensity) ]
This transformation enhances the red and yellow tones while reducing the blue tones, creating the characteristic warm, brownish appearance of old photographs.
Error Responses
Status Code | Description |
---|---|
400 | Bad request. Missing required parameters, invalid intensity value, or invalid file format. |
413 | Payload too large. The file size exceeds the maximum allowed limit. |
500 | Internal server error. Something went wrong on the server. |
Notes
- The sepia effect works best on color images. Applying it to grayscale images will still work but may produce less dramatic results.
- Setting the intensity to 0 will result in no effect (original image), while setting it to 2.0 will produce a very strong effect.
- The maximum file size allowed is 10MB.
- This operation preserves the alpha channel (transparency) if present in the original image.
- The sepia effect is commonly used to create a nostalgic or vintage appearance.
Use Cases
- Creating vintage or retro-style photographs
- Adding warmth to portraits or landscape images
- Creating a consistent aesthetic for a collection of images
- Simulating the look of old photographs for historical or nostalgic projects
- Creating artistic effects for social media posts
- Enhancing the mood of images for storytelling purposes