WORK IN PROGRESS
Read sequential and progressive JPEGs.
- Does not support arithmetic encoding.
- Add the dependency to your
shard.yml
:
dependencies:
stumpy_jpeg:
github: reiswindy/stumpy_jpeg
- Run
shards install
StumpyJPEG.read(file : String) : Canvas
reads a JPEG image from a fileStumpyJPEG.read(io : IO) : Canvas
reads a JPEG image from an IOStumpyJPEG::JPEG
holds image associated data during parsing
require "stumpy_jpeg"
canvas = StumpyJPEG.read("yamboli.jpg")
For progressive reading
require "stumpy_jpeg"
StumpyJPEG.read("yamboli.jpg") do |canvas|
r, g, b = canvas[0, 0].to_rgb8
puts "red=#{r}, green=#{g}, blue=#{b}"
end
- JFIF header parsing support
- Downsampled image support
- Arithmetic encoding support
- Add more tests
- Fork it (https://github.com/reiswindy/stumpy_jpeg/fork)
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request
- reiswindy - creator and maintainer