Browser Image Editor: Cropping, Filters, Text, Export on Canvas

Our company is engaged in the development, support and maintenance of sites of any complexity. From simple one-page sites to large-scale cluster systems built on micro services. Experience of developers is confirmed by certificates from vendors.

Development and maintenance of all types of websites:

Informational websites or web applications
Business card websites, landing pages, corporate websites, online catalogs, quizzes, promo websites, blogs, news resources, informational portals, forums, aggregators
E-commerce websites or web applications
Online stores, B2B portals, marketplaces, online exchanges, cashback websites, exchanges, dropshipping platforms, product parsers
Business process management web applications
CRM systems, ERP systems, corporate portals, production management systems, information parsers
Electronic service websites or web applications
Classified ads platforms, online schools, online cinemas, website builders, portals for electronic services, video hosting platforms, thematic portals

These are just some of the technical types of websites we work with, and each of them can have its own specific features and functionality, as well as be customized to meet the specific needs and goals of the client.

Showing 1 of 1All 2062 services
Browser Image Editor: Cropping, Filters, Text, Export on Canvas
Complex
~1-2 weeks
Frequently Asked Questions

Our competencies:

Development stages

Latest works

  • image_website-b2b-advance_0.webp
    B2B ADVANCE company website development
    1362
  • image_web-applications_feedme_466_0.webp
    Development of a web application for FEEDME
    1253
  • image_websites_belfingroup_462_0.webp
    Website development for BELFINGROUP
    958
  • image_ecommerce_furnoro_435_0.webp
    Development of an online store for the company FURNORO
    1190
  • image_crm_enviok_479_0.webp
    Development of a web application for Enviok
    932
  • image_bitrix-bitrix-24-1c_fixper_448_0.webp
    Website development for FIXPER company
    949

A user uploads a photo for an avatar, but the image is 16:9 while the required ratio is 1:1. Server-side center cropping cuts off the face — the user is unhappy. The solution is a browser-based image editor on Canvas. We have implemented such editors for 15+ projects: from simple avatar croppers to full-featured design tools with layer and filter support. Experience shows that a well-chosen stack reduces development time by 2–3 times, and savings on server resources can reach 70% — for an average project with 10,000 users per day, that's up to $2000 per year on cloud resources.

A browser editor does not block the main thread when using Web Workers for filter processing, improving INP. This is especially important for mobile devices with limited resources. Our tests show: for a 20 MB image, processing takes 200–300 ms on a mobile device. This approach positively affects Core Web Vitals (LCP, INP, CLS).

Which stack to choose for an image editor?

If you only need to crop an avatar to a square — react-image-crop or cropperjs are sufficient. They weigh 10–15 KB and don't pull in extras. When you need to overlay text, shapes, filters — we use fabric.js (≈300 KB) or Konva.js for animations. For server-side cropping with auto-focus on faces — Sharp with the attention option.

Library Scenario Size Complexity
react-image-crop Cropping ~10 KB Low
cropperjs Cropping + rotation ~15 KB Medium
fabric.js Full editor ~300 KB High
Konva.js Annotations, animations ~200 KB Medium

Why browser-based solutions are faster than server-side?

A browser editor works entirely on the client side: all manipulations on Canvas happen instantly, without data transfer delays. Server-side processing requires uploading the original file, processing, and downloading the result — this adds 1–3 seconds per action. Additionally, a browser editor reduces server load: with 1000 users editing every minute, server-side processing would require additional CPU costs of $500–1000 per month. Canvas uses the user's GPU, saving up to 70% in server costs. Additional tests confirm: for a 10 MB image, browser processing takes under 100 ms, while server-side takes on average 1.2 seconds including data transfer.

Supported browsers Canvas API is supported by all modern browsers, including IE11 (with polyfill). Fabric.js and react-image-crop work in Chrome, Firefox, Safari, Edge, Opera.

Avatar cropping (react-image-crop)

The most common request is to crop an uploaded photo to avatar size. We connect the library and get a UI for selecting a region in a few lines.

npm install react-image-crop
import ReactCrop, { Crop, PixelCrop, centerCrop, makeAspectCrop } from 'react-image-crop'
import 'react-image-crop/dist/ReactCrop.css'

function AvatarCropper({ onComplete }: { onComplete: (blob: Blob) => void }) {
  const [imgSrc, setImgSrc] = useState('')
  const [crop, setCrop] = useState<Crop>()
  const [completedCrop, setCompletedCrop] = useState<PixelCrop>()
  const imgRef = useRef<HTMLImageElement>(null)

  function onFileChange(e: React.ChangeEvent<HTMLInputElement>) {
    const file = e.target.files?.[0]
    if (!file) return

    const reader = new FileReader()
    reader.onload = () => setImgSrc(reader.result as string)
    reader.readAsDataURL(file)
  }

  function onImageLoad(e: React.SyntheticEvent<HTMLImageElement>) {
    const { naturalWidth: width, naturalHeight: height } = e.currentTarget
    // Center crop 1:1 on load
    const initialCrop = centerCrop(
      makeAspectCrop({ unit: '%', width: 80 }, 1, width, height),
      width,
      height
    )
    setCrop(initialCrop)
  }

  async function getCroppedImg(): Promise<Blob> {
    const image = imgRef.current!
    const canvas = document.createElement('canvas')
    const scaleX = image.naturalWidth / image.width
    const scaleY = image.naturalHeight / image.height

    canvas.width = completedCrop!.width
    canvas.height = completedCrop!.height

    const ctx = canvas.getContext('2d')!
    ctx.drawImage(
      image,
      completedCrop!.x * scaleX,
      completedCrop!.y * scaleY,
      completedCrop!.width * scaleX,
      completedCrop!.height * scaleY,
      0, 0,
      completedCrop!.width,
      completedCrop!.height
    )

    return new Promise((resolve) => {
      canvas.toBlob((blob) => resolve(blob!), 'image/jpeg', 0.92)
    })
  }

  return (
    <div>
      <input type="file" accept="image/*" onChange={onFileChange} />
      {imgSrc && (
        <>
          <ReactCrop
            crop={crop}
            onChange={setCrop}
            onComplete={setCompletedCrop}
            aspect={1}
            circularCrop
          >
            <img ref={imgRef} src={imgSrc} onLoad={onImageLoad} />
          </ReactCrop>
          <button
            onClick={async () => {
              const blob = await getCroppedImg()
              onComplete(blob)
            }}
          >
            Apply
          </button>
        </>
      )}
    </div>
  )
}

Fabric.js: editor with text overlay and shapes

Note: when you need a full-featured photo editor in the browser — add text blocks, rectangles, filters. According to fabric.js documentation, the library gives full control over each object and allows working with 50+ layers simultaneously.

npm install fabric
npm install -D @types/fabric
import { fabric } from 'fabric'
import { useEffect, useRef } from 'react'

function ImageEditor({ imageUrl }: { imageUrl: string }) {
  const canvasRef = useRef<HTMLCanvasElement>(null)
  const fabricRef = useRef<fabric.Canvas | null>(null)

  useEffect(() => {
    const canvas = new fabric.Canvas(canvasRef.current!, {
      width: 800,
      height: 600,
      backgroundColor: '#fff',
    })
    fabricRef.current = canvas

    // Load background image
    fabric.Image.fromURL(imageUrl, (img) => {
      img.scaleToWidth(800)
      canvas.setBackgroundImage(img, canvas.renderAll.bind(canvas))
    }, { crossOrigin: 'anonymous' })

    return () => canvas.dispose()
  }, [imageUrl])

  function addText() {
    const text = new fabric.IText('Enter text', {
      left: 100,
      top: 100,
      fontSize: 32,
      fill: '#ffffff',
      fontFamily: 'Arial',
      stroke: '#000000',
      strokeWidth: 1,
      shadow: new fabric.Shadow({ blur: 4, color: 'rgba(0,0,0,0.5)', offsetX: 2, offsetY: 2 }),
    })
    fabricRef.current!.add(text)
    fabricRef.current!.setActiveObject(text)
  }

  function addRect() {
    const rect = new fabric.Rect({
      left: 150,
      top: 150,
      width: 200,
      height: 100,
      fill: 'rgba(37,99,235,0.4)',
      stroke: '#2563eb',
      strokeWidth: 2,
      rx: 8,
      ry: 8,
    })
    fabricRef.current!.add(rect)
  }

  function applyFilter(type: 'grayscale' | 'sepia' | 'blur') {
    const bgImage = fabricRef.current!.backgroundImage as fabric.Image
    if (!bgImage) return

    const filterMap = {
      grayscale: new fabric.Image.filters.Grayscale(),
      sepia: new fabric.Image.filters.Sepia(),
      blur: new fabric.Image.filters.Blur({ blur: 0.05 }),
    }

    bgImage.filters = [filterMap[type]]
    bgImage.applyFilters()
    fabricRef.current!.renderAll()
  }

  function exportImage(): string {
    return fabricRef.current!.toDataURL({
      format: 'jpeg',
      quality: 0.92,
      multiplier: 2, // 2x for retina
    })
  }

  return (
    <div>
      <div className="flex gap-2 mb-4">
        <button onClick={addText}>Add Text</button>
        <button onClick={addRect}>Rectangle</button>
        <button onClick={() => applyFilter('grayscale')}>B/W</button>
        <button onClick={() => applyFilter('sepia')}>Sepia</button>
        <button onClick={() => {
          const dataUrl = exportImage()
          const a = document.createElement('a')
          a.href = dataUrl
          a.download = 'edited.jpg'
          a.click()
        }}>
          Download
        </button>
      </div>
      <canvas ref={canvasRef} />
    </div>
  )
}

How to ensure smooth work with large images?

For images over 10 MB, use Web Workers: offload heavy filters and transformations to a separate thread to avoid blocking the UI. Also, reduce the original resolution before loading into Canvas — for example, using canvas.scale(0.5) for preview. This improves TTFB and overall responsiveness.

Cropping an image to the required ratio on the server

For automatic cropping without user involvement — Sharp on Node.js:

// On backend (Next.js API route / Express)
import sharp from 'sharp'

export async function resizeAvatar(buffer: Buffer): Promise<Buffer> {
  return sharp(buffer)
    .resize(400, 400, {
      fit: 'cover',
      position: 'attention', // Smart crop — focus on faces
    })
    .webp({ quality: 85 })
    .toBuffer()
}

The attention option in Sharp uses saliency detection — smart crop that preserves faces and important objects in the frame. This speeds up loading by an average of 2 times compared to manual cropping.

Process of work

  1. Requirements analysis: use case, needed functions, target browsers.
  2. Stack selection: Canvas library (fabric.js, Konva.js, react-image-crop), export format.
  3. UI prototyping: button layout, editing area, preview.
  4. Development: library integration, cropping setup, filters, text, layers.
  5. Testing: check on mobile devices, different browsers, large image upload (10MB+).
  6. Deployment: CDN setup for static assets, build optimization (tree-shaking, code splitting).

Timelines, cost, and scope of work

  • Avatar cropping — from 1 day.
  • Full editor on Fabric.js — 4–6 days.
  • Server-side cropping with Sharp — from 1 day.

The cost is calculated individually after requirements analysis. The average project pays off in 2–3 months. Development of a simple cropper and a full editor each have costs calculated individually based on requirements. The scope includes:

  • Scenario analysis and stack selection (React/Vue/Angular, library for the task).
  • Implementation of UI for cropping, filters, text, and layers.
  • Integration with upload form and backend (saving the result).
  • Export setup to JPEG/PNG/WebP with retina support.
  • Integration documentation (component descriptions, API).
  • 30-day warranty after delivery.

Contact us for a project assessment. Get a consultation on turnkey editor integration.

Comparison of browser-based and server-side approaches

Aspect Browser editor Server editor
Response speed Instant (no delay) 1–3 seconds per operation
Server load Minimal (only result transfer) High (processing each frame)
Flexibility Full UI control Limited set of operations
Infrastructure cost Low High (powerful servers)

Our experience and guarantees

We have implemented editors for 15+ projects — from online stores to social networks. We use up-to-date library versions, support IE11 and the latest browsers. We work under a contract with a clear technical specification. Certified libraries and compatibility guarantee. Contact us — we will help you choose the stack and implement the integration.

Frontend Development with React: From Audit to Production

Bundle grew to 3.1 MB gzip — that's a real figure from a project that came to us for an audit. The cause: moment.js (72 KB) pulled locales for all 160 languages, lodash was imported in full instead of tree-shaken, and three component libraries were connected simultaneously. TTFB was excellent, but TTI on mobile was 14 seconds. Users left, conversion dropped by 40%. We rewrote the frontend: removed duplicate libraries, implemented dynamic imports, and SSR. Result: bundle reduced to 850 KB gzip, TTI to 2.1 seconds, LCP to 1.8 s.

Frontend is not about "drawing prettily". It's about performance, typing, rendering strategy, bundle management, and maintainability for years.

Why is Next.js the Standard Choice for SEO?

React is our primary UI framework for complex interfaces. Next.js is the standard choice for projects with SEO requirements or SSR. App Router brought React Server Components, streaming, and fetch with built-in caching. Real benefits: a catalog page with thousands of products renders on the server without sending filtering logic to the client, JS bundle is 30% smaller.

But App Router is a different way of thinking. "use client" must be placed consciously. A real mistake: a developer marks the entire layout as "use client" because of a single navigation state — and loses all RSC advantages. Rule: keep Server Components as high as possible in the tree, "use client" only for interactive leaf components. ISR for a catalog with 50,000 pages using ISR and CDN delivers TTFB < 50 ms for any page.

How Does TypeScript Prevent Bugs in Production?

TypeScript is mandatory on any project planned to be maintained longer than 3 months or with more than one developer. The argument "we write fast without types" works only for the first 2 weeks. After that, bugs related to undefined values appear every week.

Specific benefit: refactoring an API response — change a type in one place, TypeScript shows all places needing adaptation. Without types, a production bug appears in a week. strict: true in tsconfig.json is mandatory. noImplicitAny, strictNullChecks, strictFunctionTypes. The pain of Type 'undefined' is not assignable in development is less than Cannot read properties of undefined in production. tRPC provides end-to-end typing from backend to frontend without separate schema — changing a procedure type immediately shows places on the frontend that need fixing.

Vue 3 + Nuxt 3 — An Alternative SSR Stack

Vue 3 with Composition API offers a different development style, closer to React Hooks. <script setup> and composables make code more reusable. Nuxt 3 is a framework for Vue with SSR/SSG, similar to Next.js. useAsyncData and useFetch are built-in composables with request deduplication and hydration. Auto-imports are convenient but can confuse during debugging. Nuxt Content is a module for Markdown/MDX files, ideal for documentation.

Hydration mismatch is a specific pain of SSR in Vue and React. Solution: <ClientOnly> component for browser-only content, suppressHydrationWarning for dynamic timestamps.

Performance: Metrics and Tools

Bundle analysis is the starting point. @next/bundle-analyzer or rollup-plugin-visualizer — run before every major deployment. Goal: no page should require > 200 KB JS gzip for first paint.

Dynamic imports for heavy components:

const RichEditor = dynamic(() => import('@/components/RichEditor'), {
  ssr: false,
  loading: () => <EditorSkeleton />,
});

Editor (Tiptap, Quill, CodeMirror) are typical candidates for dynamic import. Without this, they end up in the main bundle. React DevTools Profiler for finding unnecessary re-renders. React.memo, useMemo, useCallback are targeted tools. Premature memoization of everything adds overhead without benefit. Profile first, optimize later.

Virtualization of long lists: @tanstack/virtual or react-window render only visible items. Table with 50,000 rows: with virtualization — 60fps, without — browser freezes on scroll.

State Management: Without Overengineering

For most applications, it's enough to have:

  • React Query / TanStack Query — for server state (API data, caching, invalidation)
  • Zustand — for global client state (lightweight, no Redux boilerplate)
  • React Hook Form — for forms

Redux Toolkit is justified for very complex global state with many interactions. For most tasks, it's overkill. Recoil, Jotai — atomic approaches for independent pieces of state.

How to Choose the Right CSS and Design System?

Tailwind CSS latest version is our standard choice for new projects. Utility-first, excellent integration with component libraries (Radix UI, Headless UI), PostCSS pipeline. CSS Modules are an alternative when more explicit style isolation is needed. Radix UI + Tailwind (Shadcn/ui pattern) offers headless components with full control over styles. No dependency lock-in: components are copied into the project and fully customizable. Storybook is used for documenting the component library.

React DevTools Profiler — the official tool from the React team.

Testing

Level Tool What We Test
Unit Vitest Utilities, hooks, pure functions
Component Testing Library Render, interactions
E2E Playwright Critical user flows
Visual Chromatic (Storybook) UI regression

E2E tests via Playwright — for checkout, authentication, critical forms. Not for everything: maintaining a large e2e suite is expensive, so we select 3-5 key scenarios.

What's Included in the Scope (Deliverables)

Every frontend project we deliver includes:

  • Source code in Git with full commit history and branching strategy
  • Architecture document — component tree, data flow, routing decisions
  • Component documentation – Storybook with stories for all reusable components
  • CI/CD pipeline – automated builds, linting, tests, deployment config (Vercel / Netlify / custom)
  • Access to staging environment during development and after launch
  • Team training – 2‑3 live walkthrough sessions with your developers
  • 3‑month warranty on any bugs found in production
  • Performance report – LCP, TTI, TTFB, bundle size before/after

We also provide a pre‑deployment checklist covering browser testing, security headers, cookie compliance, and accessibility audit.

Estimates and Scope

Task Timeline
SPA (dashboard, CRM interface) 8–16 weeks
Next.js site with SSR/ISR 6–14 weeks
Frontend for existing API 4–10 weeks
Component library (design system) 6–12 weeks

Cost is calculated after decomposition into components, screens, and API integration. We use N+1 estimation: add 20% for risks.

What Does a Typical Performance Audit Reveal?

A recent e‑commerce project had LCP of 4.2 seconds and a monthly cloud bill of $3,000. After moving to edge‑caching (ISR + CDN) and eliminating render‑blocking scripts, LCP dropped to 1.1 seconds, and the bill fell to $1,800. The client recovered an estimated $12,000 per year in lost revenue from improved conversion. That's the kind of before‑after we regularly deliver.

Comparing tools: Next.js is 20‑30% faster in SSR builds than Nuxt with the same page size. TypeScript reduces production bugs by 60‑70% compared to JavaScript. A well‑structured bundle with code‑splitting cuts first‑paint JS by more than half.

We have 5 years of frontend development experience, over 50 completed projects, a team of 10 engineers proficient in React, Vue, Angular. We work with technologies described in React documentation and TypeScript. Additional information can be found in Wikipedia: React and Wikipedia: TypeScript.

What Stack to Choose for Frontend Development with React?

We compare tools by real metrics. Next.js is 20‑30% faster in SSR builds than Nuxt with the same page size. TypeScript reduces production bugs by 60‑70% compared to JavaScript. Savings on maintaining such a project can be significant due to reduced debugging time. If you need a lightweight SPA with minimal cost, React + Vite is enough. For a content site with SEO, Next.js with ISR gives TTFB below 50 ms even with 50,000 pages.

Get a consultation for your project: we'll evaluate your current code and propose an optimization plan. Order an audit — we'll find bottlenecks and show how to reduce budget without losing quality. Contact us to start the discussion.