Skip to content
/ imgpa Public

An API to resize, change formats, and adjust image quality with ease.

License

Notifications You must be signed in to change notification settings

sekedus/imgpa

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

IMGPA

GitHub repo size GitHub Clones GitHub License

IMGPA (Image Processing API) provides an API for image manipulation using sharp. The API allows you to resize images, change formats, and adjust quality.

Table of Contents

Requirements

Installation

  1. Open your terminal and clone this repository:

    git clone https://github.com/sekedus/imgpa.git
  2. Change to the cloned directory:

    cd imgpa
  3. Install the required dependencies:

    npm install
  4. Start the server:

    npm start
  5. The server will start on port 3000 by default. You can access the API at http://localhost:3000/imgpa.

Usage

Endpoint: /imgpa

Query Parameters

Name Parameter Description Info
URL url The URL of the image to manipulate (required).
Width w Sets the width of the output image, in pixels.
Height h Sets the height of the output image, in pixels.
Fit fit Sets how to fit the image to its given dimensions. info
Quality q Defines the quality of the output image (1-100).
Format format Encodes the output image to a specific format. info
Filename filename The name to save the output image as.

Example Request

GET http://localhost:3000/imgpa?url=https://example.com/image.jpg&w=340&h=226&fit=contain&quality=80&format=webp&filename=new-image

Supported Image Formats

  • jpeg
  • png
  • webp
  • gif
  • tiff
  • avif

Deployment

One-Click Deploy

Click the button below to deploy this project to Vercel:

Deploy with Vercel

Manual Deployment

  1. Install Vercel CLI globally:

    npm install -g vercel
  2. Log in to your Vercel account:

    vercel login
  3. Deploy your application to Vercel:

    vercel --prod
  4. Follow the prompts to complete the deployment process.

Credits

License

This project is licensed under the GNU General Public License v3.0. See the LICENSE file for more details.