how to create an empty file with command

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
manit
Posts: 123
Joined: 2009-01-30T22:31:26-07:00

how to create an empty file with command

Post 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.
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: how to create an empty file with command

Post by Bonzo »

Code: Select all

convert -size 800x600 xc:none empty.png
manit
Posts: 123
Joined: 2009-01-30T22:31:26-07:00

Thank You bonzo and one more question

Post 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 ?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: how to create an empty file with command

Post 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
manit
Posts: 123
Joined: 2009-01-30T22:31:26-07:00

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

Post 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?
Last edited by manit on 2009-12-21T03:44:54-07:00, edited 4 times in total.
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: how to create an empty file with command

Post by Bonzo »

Depending on your IM version:

Code: Select all

convert -list type
or
convert -list font
manit
Posts: 123
Joined: 2009-01-30T22:31:26-07:00

Thank you bonzo.Another thing I wanted to ask ?

Post 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.
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: how to create an empty file with command

Post 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.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

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

Post 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.
manit
Posts: 123
Joined: 2009-01-30T22:31:26-07:00

Can somebody explain basics of php ?

Post 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.
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: how to create an empty file with command

Post by Bonzo »

I have some more info on my website about php use but to answer your question about circles we need more info.
Post Reply