A polished React application for removing backgrounds from uploaded images using a backend AI service. The app lets users upload an image, adjust output quality, run the background-removal process, preview the result, and download the processed image.
This project is a lightweight frontend built with React and TypeScript. It connects to a local backend API and provides a simple workflow for image background removal without requiring a complex UI.
- Drag-and-drop image upload
- Select an image from the local device
- Health check to verify backend connectivity
- Background removal request to the AI processing API
- Adjustable output quality/size slider
- Original and processed image preview
- Download the cleaned image as a PNG
- Clear error messages for invalid input or failed requests
- React
- TypeScript
- Create React App
- Fetch API
- The user uploads or drops an image in the upload area.
- The image is previewed in the app.
- The user sets the desired output quality.
- The app sends the file to the backend endpoint
/remove-bg. - The processed image is displayed and can be downloaded.
src/App.tsx— main UI and API logicsrc/App.css— styling and layoutsrc/index.tsx— app bootstrappublic/— static assets
Before running the app, make sure you have:
- Node.js and npm installed
- A backend service running locally on port 5000
The frontend includes a proxy in package.json:
"proxy": "http://localhost:5000"The app expects these endpoints:
GET /health— verifies the API is availablePOST /remove-bg— accepts an uploaded image and returns the processed output
- Install dependencies:
npm install-
Start the backend service on port 5000.
-
Run the frontend:
npm start- Open the app in the browser:
http://localhost:3000
- Click the upload area or drag an image into it.
- Adjust the quality slider if needed.
- Click “Remove Background”.
- Review the processed image.
- Download the final result.
npm startRuns the app in development mode.
npm testRuns the test watcher.
npm run buildCreates a production build in the build folder.
npm run ejectEjects the CRA configuration. Use with caution.
- Only valid image files are accepted.
- If the backend is unavailable, the app shows a connection error.
- Downloaded output is named
bg-removed.png.
This project is intended for local development and experimentation unless a separate license is added.