
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
Box Filter is a high-performance image processing library that supports box filtering operations on ImageData, Uint8ClampedArray, and two-dimensional arrays. It provides multiple optimized implementations to meet performance requirements in various scenarios.
.
├── src
│ ├── internal
│ │ └── utils.ts # Utility functions (e.g., border handling, averaging)
│ ├── batchProcessing.ts # Batch processing functionality
│ ├── benchmark.ts # Benchmark module
│ ├── borderType.ts # Border type definitions
│ ├── boxFilterArray.ts # Two-dimensional array filtering implementation
│ ├── boxFilterImageData.ts # ImageData filtering implementation
│ ├── boxFilterUint8.ts # Uint8ClampedArray filtering implementation
│ ├── index.ts # Main entry file
│ └── types.ts # Type definitions
├── package.json # Project dependencies and script configuration
└── tsup.config.json # Build tool configuration
High-Performance Filtering:
ImageData, Uint8ClampedArray, and two-dimensional arrays.Flexible Border Handling:
BorderType enumeration.Batch Processing Support:
Benchmarking:
Cross-Platform Compatibility:
Install via npm:
npm install box-filter
ImageDataimport { boxFilterImageData, BorderType } from 'box-filter';
const imageData = new ImageData(1920, 1080); // Example ImageData object
const options = {
radius: 5,
borderType: BorderType.REPLICATE,
};
const filteredImageData = boxFilterImageData(imageData, options);
Uint8ClampedArrayimport { boxFilterUint8, BorderType } from 'box-filter';
const data = new Uint8ClampedArray(1920 * 1080 * 4); // Example pixel data
const width = 1920;
const height = 1080;
const options = {
radius: 5,
borderType: BorderType.ZERO_PADDING,
};
const filteredData = boxFilterUint8(data, width, height, options);
import { boxFilterArray, BorderType } from 'box-filter';
const array = [
[1, 2, 3],
[4, 5, 6],
[7, 8, 9],
];
const options = {
radius: 1,
borderType: BorderType.WRAP,
};
const filteredArray = boxFilterArray(array, options);
The library includes a benchmarking module to measure the performance of different filtering implementations. To run benchmarks:
npm run benchmark
Example output:
Benchmark Results:
- boxFilterImageData: 12.5ms
- boxFilterUint8: 9.8ms
- boxFilterArray: 15.2ms
We welcome contributions! Please follow these steps:
git checkout -b feature/your-feature-name).git commit -m "Add some feature").git push origin feature/your-feature-name).This project is licensed under the MIT License. See the LICENSE file for details.
If you encounter any issues or have suggestions for improvement, feel free to open an issue or contact us.
FAQs
High-performance box filter implementation for image processing in TypeScript
We found that box-filter 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.