
Research
Supply Chain Attack on Axios Pulls Malicious Dependency from npm
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.
@itk-wasm/htj2k
Advanced tools
Wasm-SIMD accelerated decoding and encoding of High-throughput JPEG2000 (HTJ2K) images.
Wasm-SIMD accelerated decoding and encoding of High-throughput JPEG2000 (HTJ2K) images.
npm install @itk-wasm/htj2k
Import:
import {
decode,
encode,
setPipelinesBaseUrl,
getPipelinesBaseUrl,
setPipelineWorkerUrl,
getPipelineWorkerUrl,
} from "@itk-wasm/htj2k"
Decode a High Throughput JPEG2000 codestream and generate an ITK Image
async function decode(
webWorker: null | Worker,
codestream: Uint8Array,
options: DecodeOptions = {}
) : Promise<DecodeResult>
| Parameter | Type | Description |
|---|---|---|
codestream | Uint8Array | Input HTJ2K codestream |
DecodeOptions interface:
| Property | Type | Description |
|---|---|---|
decompositionLevel | number | Decomposition level to decode. 0 is the highest resolution. |
informationOnly | boolean | Only read metadata for the image but do not decode the pixel data. |
DecodeResult interface:
| Property | Type | Description |
|---|---|---|
| webWorker | Worker | WebWorker used for computation |
image | Image | Output image |
Encode an ITK Image into a High Throughput JPEG2000 codestream
async function encode(
webWorker: null | Worker,
image: Image,
options: EncodeOptions = {}
) : Promise<EncodeResult>
| Parameter | Type | Description |
|---|---|---|
image | Image | Input image |
EncodeOptions interface:
| Property | Type | Description |
|---|---|---|
decompositions | number | Number of wavelet decompositions |
notReversible | boolean | Lossy and not reversible, i.e. not lossless, encoding |
quantizationStep | number | Quantization step size for lossy compression. Ignored unless not reversible is enabled. |
progressionOrder | number | Progression order. 0 = LRCP, 1 = RLCP, 2 = RPCL, 3 = PCRL, 4 = CPRL |
tileSize | number[] | Tile size |
tileOffset | number[] | Tile offset |
blockDimensions | number[] | Block dimensions |
EncodeResult interface:
| Property | Type | Description |
|---|---|---|
| webWorker | Worker | WebWorker used for computation |
output | Uint8Array | Output binary HTJ2K codestream |
Set base URL for WebAssembly assets when vendored.
function setPipelinesBaseUrl(
baseUrl: string | URL
) : void
Get base URL for WebAssembly assets when vendored.
function getPipelinesBaseUrl() : string | URL
Set base URL for the itk-wasm pipeline worker script when vendored.
function setPipelineWorkerUrl(
baseUrl: string | URL
) : void
Get base URL for the itk-wasm pipeline worker script when vendored.
function getPipelineWorkerUrl() : string | URL
Import:
import {
decodeNode,
encodeNode,
setPipelinesBaseUrl,
getPipelinesBaseUrl,
setPipelineWorkerUrl,
getPipelineWorkerUrl,
} from "@itk-wasm/htj2k"
Decode a High Throughput JPEG2000 codestream and generate an ITK Image
async function decodeNode(
codestream: Uint8Array,
options: DecodeOptions = {}
) : Promise<DecodeNodeResult>
| Parameter | Type | Description |
|---|---|---|
codestream | Uint8Array | Input HTJ2K codestream |
DecodeNodeOptions interface:
| Property | Type | Description |
|---|---|---|
decompositionLevel | number | Decomposition level to decode. 0 is the highest resolution. |
informationOnly | boolean | Only read metadata for the image but do not decode the pixel data. |
DecodeNodeResult interface:
| Property | Type | Description |
|---|---|---|
image | Image | Output image |
Encode an ITK Image into a High Throughput JPEG2000 codestream
async function encodeNode(
image: Image,
options: EncodeOptions = {}
) : Promise<EncodeNodeResult>
| Parameter | Type | Description |
|---|---|---|
image | Image | Input image |
EncodeNodeOptions interface:
| Property | Type | Description |
|---|---|---|
decompositions | number | Number of wavelet decompositions |
notReversible | boolean | Lossy and not reversible, i.e. not lossless, encoding |
quantizationStep | number | Quantization step size for lossy compression. Ignored unless not reversible is enabled. |
progressionOrder | number | Progression order. 0 = LRCP, 1 = RLCP, 2 = RPCL, 3 = PCRL, 4 = CPRL |
tileSize | number[] | Tile size |
tileOffset | number[] | Tile offset |
blockDimensions | number[] | Block dimensions |
EncodeNodeResult interface:
| Property | Type | Description |
|---|---|---|
output | Uint8Array | Output binary HTJ2K codestream |
FAQs
Wasm-SIMD accelerated decoding and encoding of High-throughput JPEG2000 (HTJ2K) images.
We found that @itk-wasm/htj2k demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.

Security News
TeamPCP is partnering with ransomware group Vect to turn open source supply chain attacks on tools like Trivy and LiteLLM into large-scale ransomware operations.