Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stumpy_jpg #9

Open
drujensen opened this issue Jun 17, 2018 · 9 comments
Open

stumpy_jpg #9

drujensen opened this issue Jun 17, 2018 · 9 comments

Comments

@drujensen
Copy link

@l3kn Thanks for the great library! Anyone working on a JPG version?

@l3kn
Copy link
Collaborator

l3kn commented Jun 17, 2018

I'm glad you like it!

As far as I know there is no jpg version,
probably because the format is (much?) more complicated than png.

The jpg loader for https://github.com/PistonDevelopers/image seems to be ~3k LOC long,
implementing one in crystal could be a nice medium-size project.

Would you be interested in working on something like that?
At the moment I don't have the time to do it by myself,
but I could open up a shared “work in progress” repo
and contribute smaller parts from time to time.

@DestyNova
Copy link

DestyNova commented Aug 5, 2018

While this is still a bit fresh, and going somewhat further into madness, do you know of any efforts to build an SVG renderer in Crystal? I've just started experimenting with it half-heartedly (due to immense frustration with both PhantomJS and Batik recently), but it's my first bit of Crystal and will probably be a disaster. 🚀 So I'd be keen to hear of similar efforts.

@l3kn
Copy link
Collaborator

l3kn commented Aug 6, 2018

As far as I know there are no such projects.

If your goal is to render arbitrary svg images into some pixel based format,
I'd imagine it to be very hard because of some of the more advanced features in the
svg sepecification, e.g.

  • Filters with simulated light sources & reflections
  • Stylesheets that need to be parsed and applied in the correct order
  • Fonts could be possible using some C library,
    but parsing formats like .otf and rendering them is complicated

What do you want to build on top of that renderer?
If you only need a subset of the features,
building something like https://github.com/fogleman/gg in crystal
could be a nice alternative.

@DestyNova
Copy link

DestyNova commented Aug 6, 2018

Thanks @l3kn, you're right that it's a very big specification. My original use-case was converting an Impress animated presentation into something that could be added to a video, but the closest export format seems to be SVG 1.2. After many hours of experimentation with PhantomJS's renderer (jerky) and the Java Batik library (a mess of excessive abstractions), I decided to try writing the simplest possible program in Crystal that would convert an SVG animation into a stream of PNGs. It's more of a learning experiment than anything else, but you're right to point out the large number of difficult steps ⛰️
Even if it goes nowhere I'll be glad to get some experience with Crystal since it feels quite nice so far!

[update]
D'oh! After examining the SVG 1.2 format a bit more, I'm seeing that it can (and in my case, does) include Javascript that controls everything. That might be a step too far for me 🤣 but certainly the basic shapes should be doable.

@oprypin
Copy link

oprypin commented Aug 6, 2018

Just use Cairo or Qt

@reiswindy
Copy link
Contributor

I've been working on a stumpy_jpeg shard, but at the moment it only supports reading.
https://github.com/reiswindy/stumpy_jpeg

@l3kn
Copy link
Collaborator

l3kn commented May 17, 2019

That's awesome, I'm happy to see people are still working on this.

Let me know if you want to be added to the stumpy_cr github organization,
then all the projects are in one place.

Of course you'd keep the full control over your code
and get all the permissions you want.

@reiswindy
Copy link
Contributor

That would be great! There's still some changes I would like to make before that's done though. Would that be fine?

@l3kn
Copy link
Collaborator

l3kn commented May 24, 2019

Sure, take your time. You should be able to create a new repository here once you're done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants