In[]:=
mkRect[size_]:=Rectangle[{25/2-size,25/2-size},{25/2+size,25/2+size}]squares=Graphics[{Opacity[.5],Orange,mkRect[3.75],Blue,mkRect[7.5]},PlotRange{{0,25},{0,25}}]grid=Show[squares,GridLines{Range[0,25],Range[0,25]}]
Out[]=
Out[]=
In[]:=
tf=ImageTransformation[squares,(rd=#-0.5;0.5+rd(Norm[rd]+5Norm[rd]^3-3Norm[rd]^5))&,1000,Resampling{"Lanczos",0.5}]ImageTransformation[grid,(rd=#-0.5;0.5+rd(Norm[rd]+5Norm[rd]^3-3Norm[rd]^5))&,1000,Resampling{"Lanczos",0.5}]
Out[]=
Out[]=
In[]:=
out=Rasterize[Show[tf,GridLines{Range[0,#,#/25],Range[0,#2,#2/25]}&@@ImageDimensions[tf],GridLinesStyleDirective[Black],Method{"GridLinesInFront"True}],RasterSize2000,ImageSize540]
Out[]=