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

Speed up build_image.php #60

Merged
merged 2 commits into from
Sep 12, 2016
Merged

Conversation

noodlebox
Copy link
Contributor

For building a sprite sheet, a single call to montage is far faster than repeated calls to composite. This gives the same result with a ~50x speedup on my machine.

@iamcal
Copy link
Owner

iamcal commented Sep 12, 2016

This is a great approach. I meant to do this back when I started, but since you can't pass them on the commandline and have to use popen() i got lazy.

However, the ordering of output here is not the same as the original, so I can't merge it yet:
order

@iamcal
Copy link
Owner

iamcal commented Sep 12, 2016

(build time per sheet is now ~30s on my build box, instead of multiple minutes)

@noodlebox
Copy link
Contributor Author

noodlebox commented Sep 12, 2016

That's very strange, I get the correct order on mine. What version of imagemagick are you using? Mine is ImageMagick 6.8.9-9 Q16 x86_64 2016-06-01.

The issue seems to be that it's simply dropping the null: images instead of leaving a blank space for them.

@iamcal
Copy link
Owner

iamcal commented Sep 12, 2016

It's older:

# montage -version
Version: ImageMagick 6.5.4-7 2014-02-10 Q16 OpenMP http://www.imagemagick.org
Copyright: Copyright (C) 1999-2009 ImageMagick Studio LLC

After a yum upgrade I got:

# montage -version
Version: ImageMagick 6.7.2-7 2016-06-16 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2011 ImageMagick Studio LLC
Features: OpenMP

That built the sheets correctly. I'll add a note to make sure the ImageMagick version is recent 👍

@iamcal iamcal merged commit 19517a4 into iamcal:master Sep 12, 2016
@iamcal
Copy link
Owner

iamcal commented Sep 12, 2016

note added in 1c5928f

@noodlebox noodlebox deleted the cleanup_build_image branch September 25, 2016 00:24
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

Successfully merging this pull request may close these issues.

2 participants