Skip to content

Commit 22411b1

Browse files
committed
update README to be more accurate
- fixed the list of safe formats - use the correct license (MIT) - add missing image operations
1 parent badf748 commit 22411b1

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

README.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ The policy is _not_ enabled by default.
7373
The repository includes `priv/policy.xml` - a whitelist-based ImageMagick security policy that:
7474

7575
- **Blocks all formats by default** - Only explicitly allowed formats can be processed
76-
- **Allows safe formats**: PNG, JPEG, WebP, GIF, BMP, TIFF, AVIF, HEIC, PBM, PGM, PPM
76+
- **Allows safe formats**: PNG, JPEG, WebP, GIF, BMP, AVIF, PBM, PGM, PPM
7777
- **Blocks dangerous formats**: PDF, PostScript, MVG, MSL, SVG, XPS, WMF, EMF, and others
7878
- **Sets resource limits**: 256MB memory, 1GB disk, 30-second timeout, 16K max dimensions
7979
- **Disables dangerous features**: External command execution, file path expansion, clipboard access, module loading
@@ -159,7 +159,6 @@ gleam add alakazam
159159
image.from_file("photo.jpg")
160160
|> image.resize_contain(800, 600)
161161
|> image.to_file("resized.jpg")
162-
}
163162
```
164163

165164
## Usage Examples
@@ -352,6 +351,12 @@ image.from_file("photo.jpg")
352351
- `ordered_dither(image, pattern)` - Apply ordered dithering patterns
353352
- `colors(image, num)` - Reduce colors (use with `dither()` for smooth results)
354353
- `posterize(image, levels)` - Reduce color levels per channel
354+
- `rotate(image, degrees)` - Rotate image by specified angle
355+
- `quality(image, percent)` - Set JPEG/WebP compression quality (1-100)
356+
- `sepia(image, threshold)` - Apply sepia tone effect
357+
- `gamma(image, value)` - Apply gamma correction
358+
- `brightness_contrast(image, brightness, contrast)` - Adjust brightness and contrast
359+
- `contrast_stretch(image, black_percent, white_percent)` - Enhance contrast by stretching intensity range
355360

356361
### Transformations
357362

@@ -371,7 +376,7 @@ image.from_file("photo.jpg")
371376
- `auto_level(image)` - Auto-adjust levels
372377
- `normalize(image)` - Normalize (enhance contrast by stretching intensity range)
373378
- `background(image, color)` - Set background color
374-
- `alpha_to_image(image)` - Extract alpha channel
379+
- `alpha_to_image(image)` - Extract alpha channel as grayscale image
375380

376381
### Metadata
377382

@@ -382,11 +387,13 @@ image.from_file("photo.jpg")
382387

383388
- `to_command(image, output_path)` - Returns the ImageMagick command string without executing
384389
- `raw(image, key, value)` - Add custom ImageMagick arguments
390+
- `policy()` - List current ImageMagick security policy configuration
385391

386392
## Supported Formats
387393

388394
- PNG
389395
- JPEG
396+
- WebP
390397
- BMP
391398
- PBM (Portable Bitmap)
392399
- PGM (Portable GrayMap)
@@ -407,4 +414,4 @@ Further documentation can be found at [https://hexdocs.pm/alakazam](https://hexd
407414

408415
## License
409416

410-
This project is licensed under the Apache License 2.0.
417+
This project is licensed under the MIT License.

0 commit comments

Comments
 (0)