[ncl-talk] PNG trim error before doing animated Gif, all the space outside the trimmed area now is black colored.

Sebastian Otarola-Bustos Sebastian.F.Otarola-Bustos.1 at nd.edu
Wed Sep 23 12:24:47 MDT 2015


Hi everybody,

I've been making animations without troubles converting .png to .gif using
the following commands: convert -trim & convert -delay, so I'm cutting the
white space with trim and then doing the animation with -delay. The strange
thing is that if I see each .png file separately, it's cutted ok, as it
showns in Figure1, but after doing the animation with the cutted files, you
can see the trimmed area, but the difference between the cutted area and
the original size is all filled with black as you can see in Figure2. Here
you can see the main steps of my scripts:


  *do n=0,ntimes-1,4*

*      wks_type            = "png"*
*      wks_type at wkWidth    = 1700*
*      wks_type at wkHeight   = 1700*
*      wks = gsn_open_wks("png","animate"+sprinti("%03i",n))    ;
animate_000.png, animate_001.png, etc*
*      print("Trabajando en el tiempo: " + times(n))*
*      mpres at gsnRightString  = " Velocity(m/s):  "+ times(n)*
*      mpres at gsnLeftString = " "*

*      mpid   = gsn_csm_map(wks,mpres)*
*      V  = gsn_csm_contour(wks,speed(n,:,:),spres)*
*      wind = gsn_csm_vector(wks,u(n,:,:),v(n,:,:),Vres)*
*      Heig    =gsn_csm_contour(wks,ter(:,:),ter_res)*

*      overlay(mpid,V)*
*      overlay(mpid,Heig)*
*      overlay(mpid,wind)*
*      maximize_output(wks,True)*
*      delete(wks)*
*      cmd="convert -trim animate"+sprinti("%03i",n)+".png
"+"animate"+sprinti("%03i",n)+".png"*
*      system(cmd)*


*  end doINS = "convert -delay 50 animate*.png velocity_3.gif" system(INS)*

I still cannot see the error, and any help would be really appreciated as
always,

All the best,
Thank you very much,
Sebastián.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150923/544fdb0d/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Figure_1.PNG
Type: image/png
Size: 124596 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150923/544fdb0d/attachment.png 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Figure_2.PNG
Type: image/png
Size: 109313 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150923/544fdb0d/attachment-0001.png 


More information about the ncl-talk mailing list