Page 1 of 1

how to create an empty file with command

Posted: 2009-12-19T06:47:59-07:00
by manit
i want to make 800x600 png file using only command line .
File should be empty that is background transparent.How can I do this ?
Actually I don't like to use graphical interface.

Re: how to create an empty file with command

Posted: 2009-12-19T07:40:47-07:00
by Bonzo

Code: Select all

convert -size 800x600 xc:none empty.png

Thank You bonzo and one more question

Posted: 2009-12-20T23:02:14-07:00
by manit
Thank you bonzo.
i have one more question .
QUESTION
I want to create a strip on which just lxuser is written.

what I normally do is
convert -size 800x600 xc:white empty.png
composite label:lxuser empty.png lxuser.png
Then i have to crop the 800x600 lxuser.png image since I want just the text .

i think there should be an easy way ?
what do you suggest ?

Re: how to create an empty file with command

Posted: 2009-12-20T23:12:16-07:00
by fmw42
try

convert -background white -size 800x label:"lxuser" -trim +repage lxuser.png


see using just width to specify the text for label and automatically fit font and text to that width at http://www.imagemagick.org/Usage/text/#label and -trim to remove any excess white

see -trim at http://www.imagemagick.org/script/comma ... s.php#trim

thank you fmw42.Please see my 'font' question ?

Posted: 2009-12-21T03:12:39-07:00
by manit
from the link you pointed out
All guys who want to make image containing just text can do with following simple single (one line) command(credit to fmw42 and bonzo)

Code: Select all

convert -background white -fill black -pointsize 72 label:WhateverYouWantToWrite OutputFile
was the simplest because here we are just mentioning that pointsize should be 72 & imagemagick does rest of selecting picture dimensions(width as well as height).


But when I tried
convert -background lightblue -fill blue -font Candice -pointsize 72 label:Anthony label.gif
output was
convert: unable to read font `Candice'.
SOLUTION
i had to specify path to font file then it worked.
QUESTION
Can you tell command to find out fonts IM knows & how can we add to that list?

Re: how to create an empty file with command

Posted: 2009-12-21T03:29:52-07:00
by Bonzo
Depending on your IM version:

Code: Select all

convert -list type
or
convert -list font

Thank you bonzo.Another thing I wanted to ask ?

Posted: 2009-12-21T03:35:03-07:00
by manit
how can I see preview of all fonts supported ?

PS:I am pleased with prompt reply at this forum & amazed at plethora of things imagemagick can do though i know little about image manipulation.

Re: how to create an empty file with command

Posted: 2009-12-21T03:54:15-07:00
by Bonzo
If you can use php try the examples on this page:
http://www.rubblewebs.co.uk/imagemagick ... /fonts.php

Otherwise my previous post should list all the fonts. If I want to use a special font I just use the path with -font.

Re: Thank you bonzo.Another thing I wanted to ask ?

Posted: 2009-12-21T10:36:30-07:00
by fmw42
manit wrote:how can I see preview of all fonts supported ?

PS:I am pleased with prompt reply at this forum & amazed at plethora of things imagemagick can do though i know little about image manipulation.
see show_fonts and imagick_type_gen scripts at http://www.imagemagick.org/Usage/scripts/

Unfortunately the author Anthony is on extended vacation.

Can somebody explain basics of php ?

Posted: 2009-12-23T03:46:23-07:00
by manit
I want to learn basics of php .
How can it help in tedious work like sometimes I have to create hundreds of circle each of different colour then I put all command in script then execution takes time maybe because 'convert' has not been given the job collectively.

Re: how to create an empty file with command

Posted: 2009-12-23T10:05:12-07:00
by Bonzo
I have some more info on my website about php use but to answer your question about circles we need more info.