Month: August 2009

nl2br in perl

How to replace new line character with br

$tempString = “Hello is testing for new line\n to br”;

$tempString =~ s/\n/<br\/>/;

output = “Hello is testing for new line
to br”;

How to convert bitmap image(.jpg , .jpeg, .gif, .png) to vector format (.ai , .eps, .svg)

For converting bitmap image to vector image you need to have autotrace library installed .

If you not installed you can install that bu using the command “yum install autotrace”.

Follow the instruction step till the installation is complete.

Once its installed you can use the below command to convert the image to vector format.

$ autotrace testInputImage.png -output-file testOutputImage.svg

Other example :

$autotrace –input-format=jpg –output-file=tshirt.ai –dpi=1024 –color-count=256 –despeckle-level=0 –despeckle-tightness=0 –corner-always-threshold=60 –line-threshold=0.1 –width-weight-factor=0.1 –line-reversion-threshold=0.1 –preserve-width –remove-adjacent-corners tshirt.ai 2>&1

and your are done.

For more information and option visit http://autotrace.sourceforge.net

Thanks