stumpy_png alternatives and similar shards
Based on the "Misc" category.
Alternatively, view stumpy_png alternatives based on common mentions on social networks and blogs.
-
sentry
Build/Runs your crystal application, watches files, and rebuilds/restarts app on file changes -
immutable
Thread-safe, persistent, immutable collections for the Crystal language -
crystagiri
An Html parser library for Crystal (like Nokogiri for Ruby) -
crz
Functional programming library for https://github.com/crystal-lang/crystal -
crystal-web-framework-stars
⭐️ Web frameworks for Crystal, most starred on Github -
cron_scheduler
Simple job scheduler with crontab patterns for Crystal Language. -
crystal-futures
Future type implementation for Crystal language -
inflector.cr
Inflector shard for Crystal. A port of ActiveSupport::Inflector -
aasm.cr
:arrows_clockwise: Easy to use finite state machine for Crystal classes -
kreal
Kreal is a model sharing & RPC library built on and works with Kemal seamlessly. -
retriable.cr
Retriable.cr is a simple DSL to retry failed code blocks -
ulid
Universally Unique Lexicographically Sortable Identifier (ULID) in Crystal -
CrSerializer
Extensible annotation based serialization/deserialization library -
circuit_breaker
Implementation of the circuit breaker pattern in crystal -
burocracia.cr
No dependency Crystal shard to validate, generate and format Brazilian burocracias such as CPF, CNPJ and CEP -
wikicr
Wiki in crystal, using Markdown and Git, inspired by dokuwiki. Last features to build are pretty hard, if you have some time to help... :) -
m3u8
Generate and parse m3u8 playlists for HTTP Live Streaming (HLS) in Crystal. -
message_verifier.cr
Rails compatible MessageVerifier for Crystal-lang apps
Build time-series-based applications quickly and at scale.
Do you think we are missing an alternative of stumpy_png or a related project?
README
stumpy_png
Interface
StumpyPNG.read(path : String) : Canvas
read a PNG image file from a pathStumpyPNG.read(io : IO) : Canvas
read a PNG image file from any IO objectStumpyPNG.write(canvas, path : String, bit_depth: 16, color_type: :rgb_alpha)
save a canvas as a PNG image fileStumpyPNG.write(canvas, io : IO, bit_depth: 16, color_type: :rgb_alpha)
write a canvas as PNG data to any IO objectbit_depth
is optional, valid values are8
and16
(default)color_type
is optional, valid values are:grayscale
,:grayscale_alpha
,:rgb
and:rgb_alpha
(default)
StumpyPNG::PNG
, helper class to store some state while parsing PNG filesCanvas
andRGBA
from stumpy_core
Usage
Install the stumpy_png
shard
shards init
- Add the dependency to the
shard.yml
fileyaml ... dependencies: stumpy_png: github: stumpycr/stumpy_png version: "~> 5.0" ...
shards install
Reading
require "stumpy_png"
canvas = StumpyPNG.read("foo.png")
r, g, b = canvas[0, 0].to_rgb8
puts "red=#{r}, green=#{g}, blue=#{b}"
Writing
require "stumpy_png"
include StumpyPNG
canvas = Canvas.new(256, 256)
(0..255).each do |x|
(0..255).each do |y|
# RGBA.from_rgb_n(values, bit_depth) is an internal helper method
# that creates an RGBA object from a rgb triplet with a given bit depth
color = RGBA.from_rgb_n(x, y, 255, 8)
canvas[x, y] = color
end
end
StumpyPNG.write(canvas, "rainbow.png")
[PNG image with a color gradient](examples/rainbow.png)
(See examples/
for more examples)
Reading PNG files
Color Types
- [x] Grayscale
- [x] Grayscale + Alpha
- [x] RGB
- [x] RGB + Alpha
- [x] Palette
Filter Types
- [x] None
- [x] Sub
- [x] Up
- [x] Average
- [x] Paeth
Interlacing Methods
- [x] None
- [x] Adam7
Ancillary Chunks
None are supported right now.
Writing
- RGB with 8 or 16 bits
- RGB + Alpha with 8 or 16 bits
- Grayscale with 8 or 16 bits
- Grayscale + Alpha with 8 or 16 bits
Troubleshooting
If you run into errors like
/usr/bin/ld: cannot find -lz
collect2: error: ld returned 1 exit status
make sure zlib
is installed
(Installing zlib under ubuntu).
Contributors
Thanks goes to these wonderful people (emoji key):
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --> <!-- prettier-ignore --> | Chris Hobbs💻 | Ary Borenszweig💻 | Alex Muscar💻 | Dru Jensen💻 | kojix2📖 | obskyr💻 | r00ster💻 | | :---: | :---: | :---: | :---: | :---: | :---: | :---: | <!-- ALL-CONTRIBUTORS-LIST:END -->
This project follows the all-contributors specification. Contributions of any kind welcome!