Skip to main content
Deno 2 is finally here 🎉️
Learn more

Deno.js Image Processor - dimg

Features

  • Crop
  • Resize
  • Convert
  • Get info

Use

Importing

  import * as dimg from 'https://deno.land/x/dimg/mod.ts'

Crop image

  const img = await Deno.readFile(`./image.png`)

  dimg.crop(
    img,
    {
      x: 328,
      y: 340,
      w: 100,
      h: 100
    }
  )

  .then((res: Uint8Array) => {
    Deno.writeFile(`./res_image.png`, res)
    console.info('Done')
  })
  .catch((err: Error) => {
    console.error(err)
  })