Login / Register 0 items | $0.00 New @ KVR
User avatar
Audiority
KVRian
 
724 posts since 15 Nov, 2005, from Italy

Postby Audiority; Sat Mar 03, 2018 9:43 am PNG Strips

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
Progsounds | Audiority | Epic SoundLab
Need a Kontakt scripter? Contact me.
User avatar
Totolitoto
KVRAF
 
1868 posts since 7 Jan, 2004, from Earth

Postby Totolitoto; Sat Mar 03, 2018 9:48 am Re: PNG Strips

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/
User avatar
Audiority
KVRian
 
724 posts since 15 Nov, 2005, from Italy

Postby Audiority; Sat Mar 03, 2018 9:53 am Re: PNG Strips

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.
Progsounds | Audiority | Epic SoundLab
Need a Kontakt scripter? Contact me.
User avatar
Totolitoto
KVRAF
 
1868 posts since 7 Jan, 2004, from Earth

Postby Totolitoto; Sat Mar 03, 2018 9:56 am Re: PNG Strips

I mabe knobs with 128 frames without a problem
Did you try it?
mystran
KVRAF
 
4979 posts since 11 Feb, 2006, from Helsinki, Finland

Postby mystran; Sat Mar 03, 2018 10:32 am Re: PNG Strips

Audiority wrote:what are you using to combine several png frames in a vertical strip?


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).

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.


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?

(don't ask me how to do it, but judging by the manual it seems that it should be possible :help: )
Image <- plugins | forum
User avatar
Audiority
KVRian
 
724 posts since 15 Nov, 2005, from Italy

Postby Audiority; Sat Mar 03, 2018 10:36 am Re: PNG Strips

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.
Progsounds | Audiority | Epic SoundLab
Need a Kontakt scripter? Contact me.
User avatar
Audiority
KVRian
 
724 posts since 15 Nov, 2005, from Italy

Postby Audiority; Sat Mar 03, 2018 4:31 pm Re: PNG Strips

Totolitoto wrote:I mabe knobs with 128 frames without a problem
Did you try it?


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.
Progsounds | Audiority | Epic SoundLab
Need a Kontakt scripter? Contact me.
Ivan_C
KVRian
 
1062 posts since 11 Aug, 2004, from Marcoussis, France

Postby Ivan_C; Sat Mar 03, 2018 11:36 pm Re: PNG Strips

Do yourself a favor, spend 1 day coding an application that does all the things you need, it's quite simple with JUCE
User avatar
Audiority
KVRian
 
724 posts since 15 Nov, 2005, from Italy

Postby Audiority; Sun Mar 04, 2018 9:21 am Re: PNG Strips

Yes, Ivan. Looks like that's the best option to me.

Thank you all, guys.

Cheers,
Luca
Progsounds | Audiority | Epic SoundLab
Need a Kontakt scripter? Contact me.
User avatar
EvilDragon
KVRAF
 
16779 posts since 6 Jan, 2009, from Croatia

Postby EvilDragon; Sun Mar 04, 2018 9:28 am Re: PNG Strips

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:

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)


Above script expects input images named "frame1.png", "frame2.png" etc., up to num_frames.
AnX
KVRAF
 
2885 posts since 17 Nov, 2015

Postby AnX; Sun Mar 04, 2018 9:39 am Re: PNG Strips

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
earlevel
KVRist
 
473 posts since 4 Apr, 2010

Postby earlevel; Sun Mar 18, 2018 9:43 am Re: PNG Strips

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&hilit=imsave#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:

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
Miles1981
KVRian
 
1355 posts since 26 Apr, 2004, from UK

Postby Miles1981; Mon Mar 19, 2018 2:25 pm Re: PNG Strips

EvilDragon 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).

Also what I'm using. Dead simple. And then you can use Python for DSP validation as well, no reason no to use it :D
User avatar
Branis
KVRian
 
1301 posts since 21 May, 2004, from Serbia

Postby Branis; Mon Mar 19, 2018 2:33 pm Re: PNG Strips

There's PNG Stitch, it's made for that one purpose
User avatar
Audiority
KVRian
 
724 posts since 15 Nov, 2005, from Italy

Postby Audiority; Thu Mar 22, 2018 12:56 am Re: PNG Strips

Thanks!
Progsounds | Audiority | Epic SoundLab
Need a Kontakt scripter? Contact me.
Next

Moderator: KVR Moderators (Main)

Return to DSP and Plug-in Development