Skip to content

Instantly share code, notes, and snippets.

@egonelbre
Created February 17, 2012 10:47
Show Gist options
  • Save egonelbre/1852609 to your computer and use it in GitHub Desktop.
Save egonelbre/1852609 to your computer and use it in GitHub Desktop.
flower packing
Packed with http://iteral.com/jscrush/ 1216B --> 955B
from 1216B
O=a.getImageData(0,0,c.height=f=W=256,f);U=O.data;D={};F=[];function J(p){p[5]=Q=0;for(j=3;j--;)if(!D[Q=(p[j]>>=2)+Q*f])D[Q]=F.push(p)}setInterval(function(){for(i=1e3;i--;){c=i%42*1.35;H=T;T=Math.random();A=H*2-1;B=T*2-1;J([Math.sin(H*7)*(o=13+5/(.2+Math.pow(T*4,4)))-T*50,T*550+500,(l=Math.cos(H*7))*o,(G=l/7+.5)-T/4,G]);if(A*A+B*B<1)if(c>32){J([(o=.5/(H+.01)-H*300)*Math.cos(n=(j=c&1)?6:4)+(w=T*-f)*Math.sin(n)+j*630-390,o*Math.sin(n)-w*Math.cos(n)+999-j*350,Math.cos(B+A)*99-j*50,(Math.pow(l=1-B*B,f*6)+Math.cos(H+T)+Math.pow(Math.cos((o*H+o+(B>0?w:-w))/25),30)*l-H+2)/5,o/1e3+.7-o*w/3e5]);J([(o=H*45-20)*Math.cos(l=c/.86)+(w=T*T)*f*Math.sin(l),Math.cos(B/2)*99-w*T*60+436,o*Math.sin(l)-w*f*Math.cos(l),w*.3+.3,T*.7])}else J([(o=A*(2-T)*(80-c*2))*Math.cos(c)-(w=99-Math.cos(A)*120-Math.cos(T)*(f-c*5)+Math.cos(Math.pow(1-T,7))*50+c*2)*Math.sin(c),(B*2-Math.cos(Math.pow(T,7))+9)*50,o*Math.sin(c)+w*Math.cos(c),1-T*.7,Math.pow(1-T,9)/4])}for(i=0;i<f*f;Math[i++]=f)for(l=4;l--;)U[i*4+l]=255;for(c=Math.cos(W),s=Math.sin(W),j=F.length;j--;){k=F[j],x=k[0]*c+k[2]*s+99,z=k[0]*s-k[2]*c,y=k[1]-z*.4<<8;for(i=3;i--;)if(z<Math[p=y-~x+[0,1,f][i]])for(Math[p]=z,l=3;l--;)U[p*4+l]=k[l+3]*f}a.putImageData(O,0,0);W+=.03},T=0)
to 955B
_='O=a.ge c.height=f=W=256,f);U=O.data;D={};F=[]; J(p){p[5Q=0;j=3;j!D[Q=(p[j]>>=2 Q*fD[QF.push(p)}setInterval((){1eK{c=i%42*1.35;H=T;T=random();A=$1;B=$1;J([7(o=13+5/(.2+4,4))@550+50 (7)o,(G=l/7C5T/4,G;A*A+B*B<1)c>32){.5/(HC01300n=(j=c&1)?6:4 -fn j*630-39 nn 9j*3@B+Aj*@(1-B*B,E6 H+T (H+o+(B>0?w:-w))/2530l-H+2)/5,o/1e3C7-w/3e5;45-20c/.86 TElB/260+436,lEl.3C3,.7}else A*($T(80-c*2)cA120-T(f-c*5 7)50+c*2c(B*$T,7) 9@c c1-.7,9)/4}0;i<Ef;[i++f)4#iL255;c=Ws=Wj=F.length;j{k=F[j],x0c+Ns+99,z0s-Nc,y1]-z*.4<<8;Kz<[p=y-~x+[ 1,f][i][pz,3#pL]l+3f}a.pu O, 0);W+=.03},T=0).cos(sin(pow(for()*--;)J([(o= tImageData( 0, )+MathT*function),if(99-=k[]))-]=H*l=o*w*]*i=(w=1-T,#;lU[$2-@5 C+.Ef*K3;iL*4+lNk[2';for(Y=0;$='NLKEC@$# '[Y++];)with(_.split($))_=join(pop());eval(_)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment