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

DenoJS Image - dimg

Features

  • Crop
  • Resize
  • Convert
  • Get infos

Use

Importing

  import {
    crop
  } from '../mod.ts'

Crop image

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

  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)
  })