Socket
Socket
Sign inDemoInstall

@jimp/plugin-rotate

Package Overview
Dependencies
Maintainers
2
Versions
241
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jimp/plugin-rotate

Rotate an image.


Version published
Weekly downloads
1.3M
increased by5.96%
Maintainers
2
Weekly downloads
 
Created

What is @jimp/plugin-rotate?

@jimp/plugin-rotate is a plugin for the Jimp image processing library that provides functionality to rotate images. It allows users to rotate images by a specified number of degrees, either clockwise or counterclockwise.

What are @jimp/plugin-rotate's main functionalities?

Rotate Image

This feature allows you to rotate an image by a specified number of degrees. In this example, the image is rotated by 90 degrees and then saved to a new file.

const Jimp = require('jimp');

Jimp.read('path/to/image.jpg')
  .then(image => {
    return image.rotate(90) // rotate image by 90 degrees
      .write('path/to/rotated-image.jpg'); // save
  })
  .catch(err => {
    console.error(err);
  });

Rotate Image with Background Color

This feature allows you to rotate an image by a specified number of degrees and fill the background with a specified color. In this example, the image is rotated by 45 degrees with a white background.

const Jimp = require('jimp');

Jimp.read('path/to/image.jpg')
  .then(image => {
    return image.rotate(45, false, 0xFFFFFFFF) // rotate image by 45 degrees with white background
      .write('path/to/rotated-image.jpg'); // save
  })
  .catch(err => {
    console.error(err);
  });

Other packages similar to @jimp/plugin-rotate

FAQs

Package last updated on 23 Feb 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc