PNG Strips
- KVRian
- Topic Starter
- 1324 posts since 15 Nov, 2005 from Italy
Hey guys,
what are you using to combine several png frames in a vertical strip?
So far I used ImageMagick, but I just found out that it's slightly changing the png colors when I combine them... so I'm looking for an alternavie, possibly on Mac.
Cheers,
Luca
what are you using to combine several png frames in a vertical strip?
So far I used ImageMagick, but I just found out that it's slightly changing the png colors when I combine them... so I'm looking for an alternavie, possibly on Mac.
Cheers,
Luca
- KVRAF
- 1908 posts since 7 Jan, 2004 from Earth
This is pretty amazing, and online
You can save the page too, the scipt will still work when offline!
http://www.cssportal.com/css-sprite-generator/
You can save the page too, the scipt will still work when offline!
http://www.cssportal.com/css-sprite-generator/
- KVRian
- Topic Starter
- 1324 posts since 15 Nov, 2005 from Italy
Thanks, but unfortunately that's not for me since my strips are made of over 100 files and sometimes each frame can be pretty big.
- KVRAF
- 1908 posts since 7 Jan, 2004 from Earth
- KVRAF
- 7891 posts since 12 Feb, 2006 from Helsinki, Finland
I've used a Gimp script in the past, there's a few on the web. To use these you usually use "open as layers" in Gimp to load all the files as layers and then run a script that merges them into a single image (whether strip or grid or whatever).Audiority wrote: what are you using to combine several png frames in a vertical strip?
Maybe it's a colorspace thing where IM is trying to be helpful and output sRGB and the input images have colorspace metadata for something else so it ends up converting? You could try telling IM to just assume the inputs are sRGB and see if that helps?So far I used ImageMagick, but I just found out that it's slightly changing the png colors when I combine them... so I'm looking for an alternavie, possibly on Mac.
(don't ask me how to do it, but judging by the manual it seems that it should be possible )
- KVRian
- Topic Starter
- 1324 posts since 15 Nov, 2005 from Italy
Thanks, guys. I checked the colorspace and it's sRGB for all frames. I already tried forcing IM to use the same colorspace for all the files, but the result it's still wrong.
- KVRian
- Topic Starter
- 1324 posts since 15 Nov, 2005 from Italy
I noticed the process is client side, so I tried and I found something.. if I join just a couple of frames, the color doesn't change. Instead, if I join ALL my frames, I get the same error. I never experienced something like that before.Totolitoto wrote:I mabe knobs with 128 frames without a problem
Did you try it?
-
- KVRian
- 1153 posts since 11 Aug, 2004 from Breuillet, France
Do yourself a favor, spend 1 day coding an application that does all the things you need, it's quite simple with JUCE
- KVRian
- Topic Starter
- 1324 posts since 15 Nov, 2005 from Italy
- KVRAF
- 23102 posts since 7 Jan, 2009 from Croatia
JKnobman can do it. Or a python script (provided you have PIL installed - if you install Anaconda distro of Python, you will have it available along with it). Example:
Above script expects input images named "frame1.png", "frame2.png" etc., up to num_frames.
Code: Select all
from PIL import Image
filename = 'frame'
outfile = 'output.png'
num_frames = 100
step = 1
images = [Image.open(filename + '%d.png' % i) for i in range(1,num_frames+1,step)]
width, height = images[0].size
big_image = Image.new(images[0].mode, (width, height * len(images)))
for i, img in enumerate(images):
big_image.paste(img, (0, height * i))
big_image.save(outfile)
- Banned
- 10732 posts since 17 Nov, 2015
viewtopic.php?t=100816
Also Tobybear did some graphic utils here
https://www.tobybear.de/files.html
I think they are win only, but def has an image stitcher/unstitcher
Also Tobybear did some graphic utils here
https://www.tobybear.de/files.html
I think they are win only, but def has an image stitcher/unstitcher
-
- KVRian
- 653 posts since 4 Apr, 2010
It's trivial in python. Basically, you read images as two dimensional arrays, append to a composite "film strip" array, save it as an image. See a post of mine here: viewtopic.php?f=33&t=366384&p=6194549&h ... e#p6194549
But to recap, my actual python script is a more complicated, because I needed it to assemble ancient PICT resources and convert associated mask files to alpha, but this is the gist of it; note I'm using a numerical naming convention (100.png, 101.png...) and the calling parameters have the starting number and how many, but you can see the hard work is just a read and concatenate of each, then save the result:
But to recap, my actual python script is a more complicated, because I needed it to assemble ancient PICT resources and convert associated mask files to alpha, but this is the gist of it; note I'm using a numerical naming convention (100.png, 101.png...) and the calling parameters have the starting number and how many, but you can see the hard work is just a read and concatenate of each, then save the result:
Code: Select all
from scipy import misc
import numpy
for idx in range(0, numFrames):
tempImage = misc.imread(inFileDir + "/" + str(baseNum + idx) + ".png")
if (idx == 0):
newImage = tempImage
else:
newImage = numpy.concatenate((newImage, tempImage))
misc.imsave(outFilePath, newImage)
My audio DSP blog: earlevel.com
-
- KVRian
- 1379 posts since 26 Apr, 2004 from UK
Also what I'm using. Dead simple. And then you can use Python for DSP validation as well, no reason no to use itEvilDragon wrote:JKnobman can do it. Or a python script (provided you have PIL installed - if you install Anaconda distro of Python, you will have it available along with it).
- KVRian
- 1361 posts since 21 May, 2004 from Serbia
- KVRian
- Topic Starter
- 1324 posts since 15 Nov, 2005 from Italy