
Security News
Insecure Agents Podcast: Certified Patches, Supply Chain Security, and AI Agents
Socket CEO Feross Aboukhadijeh joins Insecure Agents to discuss CVE remediation and why supply chain attacks require a different security approach.
vision-camera-cropper-sked
Advanced tools
A react native vision camera frame processor for cropping
For Vision Camera v3, use versions 0.x.
For Vision Camera v4, use versions >= 1.0.0.
yarn add vision-camera-cropper
cd ios && pod install
Add the plugin to your babel.config.js:
module.exports = {
plugins: [['react-native-worklets-core/plugin']],
// ...
Note: You have to restart metro-bundler for changes in the
babel.config.jsfile to take effect.
Crop a frame and return its base64 or path.
import { crop } from 'vision-camera-cropper';
// ...
const frameProcessor = useFrameProcessor((frame) => {
'worklet';
//coordinates in percentage
const cropRegion = {
left:10,
top:10,
width:80,
height:30
}
const result = crop(frame,{cropRegion:cropRegion,includeImageBase64:true,saveAsFile:false});
console.log(result.base64);
}, []);
Rotate an image.
const rotated = await rotateImage(base64,degree);
If you are developing a plugin to get the camera frames, you can use reflection to get it as Bitmap or UIImage on the native side.
Java:
Class cls = Class.forName("com.visioncameracropper.CropperFrameProcessorPlugin");
Method m = cls.getMethod("getBitmap",null);
Bitmap bitmap = (Bitmap) m.invoke(null, null);
Objective-C:
- (UIImage*)getUIImage{
UIImage *image = ((UIImage* (*)(id, SEL))objc_msgSend)(objc_getClass("CropperFrameProcessorPlugin"), sel_registerName("getBitmap"));
return image;
}
You have to pass {saveBitmap: true} for the crop function.
How to Create a React Native Vision Camera Plugin to Crop Frames
See the contributing guide to learn how to contribute to the repository and the development workflow.
MIT
Made with create-react-native-library
FAQs
A react native vision camera frame processor for cropping
The npm package vision-camera-cropper-sked receives a total of 6 weekly downloads. As such, vision-camera-cropper-sked popularity was classified as not popular.
We found that vision-camera-cropper-sked demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Security News
Socket CEO Feross Aboukhadijeh joins Insecure Agents to discuss CVE remediation and why supply chain attacks require a different security approach.

Security News
Tailwind Labs laid off 75% of its engineering team after revenue dropped 80%, as LLMs redirect traffic away from documentation where developers discover paid products.

Security News
The planned feature introduces a review step before releases go live, following the Shai-Hulud attacks and a rocky migration off classic tokens that disrupted maintainer workflows.