2010年1月11日星期一

“物有所不足,智有所不明‘怎么理解”谁说的?

屈原在楚辞"卜居"中,
问卜道;"宁与黄鹄比翼乎?将与鸡鹜争食乎?孰吉孰凶?何去何从?世混浊而不清,蝉翼为重,千钧为轻;黄钟毁弃,瓦釜雷鸣;谗人高张,贤士无名。吁嗟默默兮,谁知吾之廉贞?"。
卜者释策而谢曰:"尺有所短,寸有所长,物有所不足,智有所不明,数有所不逮,神有所不通。用君之心,行君之意,龟策诚不能知此事!"。

屈原是一位伟大的殉道者
<卜居篇>表明,屈原在忠而被谤、遭到流放的情况下,内心焦虑彷徨,欲通过占卜决定命运,以获得精神突围.但卜者回答,万物皆有所长短,智慧也会遇到无法辨清的情况和时候(可能包括,卜不能决定屈原的选择,君王不能确知臣下的忠贞,还有屈原对现状的不满无法理解,等多个方面的智的迷惑);屈原最终选择了殉道。

万物各有优势和弱点,人人都会遇到智慧无法理清的情况
卜算有算不到的地方,神仙还有不灵通的时候
从你的心出发,做你想做的事。。。。。。

楚辞 卷六

卜居

屈原既放,三年不得复见,竭知眒忠,而蔽鄣於谗,心烦虑乱,不知所从。乃往见太卜郑詹尹曰:「余有所疑,愿因先生泀之。」詹尹乃端策拂龟曰:「君将何以教之?」屈原曰:

「吾宁悃悃款款,朴以忠乎?

将送往劳来,斯无竑乎?

宁诲锄草茅,以力耕乎?

将游大人,以成名乎?

宁正言不謒,以危身乎?

将从俗富賔,以偷生乎?

宁超然高举,以保真乎?

将唜訾栗斯,喔咿嚅儿,以事媎人乎?

宁廉洁正直,以自清乎?

将突梯滑稽,如脂如韦,以洁楹乎?

宁昂昂若千里之驹乎?

将氾氾若水中之鸨乎?

与波上下,偷以全吾躯乎?

宁与騯髃亢轭乎?

将杂驽駌之踖乎?

宁与黶鹄比翼乎?

将与鸡鷉争食乎?

此孰吉孰凶?

何去何从?

世溷浊而不清:

蝉翼为重,千钧为轻;

黶钟毁弃,瓦釜雷鴔;

谗人高张,贤士无名。

吁嗟默默兮,谁知吾之廉贞?」

詹尹乃释策而谢曰:「夫尺有所短,寸有所闸,物有所不足,智有所不明,数有所不逮,神有所不通,用君之心,行君之意。龟策诚不能知事。」

Steve Jobs: 我生命中的三个故事

――苹果电脑的CEO斯蒂夫・乔布斯在05年6月12日斯坦福大学毕业典礼上的演讲

(斯坦福)是世界上最好的大学之一,今天能参加各位的毕业典礼,我备感荣幸。(尖叫声)我从来没有从大学毕业,说句实话,此时算是我离大学毕业最近的一刻。(笑声)今天,我想告诉你们我生命中的三个故事,并非什么了不得的大事件,只是三个小故事而已。

第一个故事,是关于串起生命中的点点滴滴。(原文为"connecting the dots"指一种小游戏:把标有序列号的点连起来,就构成一幅图画――译注)

我在里德大学呆了6个月就退学了,但之后仍作为旁听生混了18个月后才最终离开。我为什么要退学呢?

故事要从我出生之前开始说起。我的生母是一名年轻的未婚妈妈,当时她还是一所大学的在读研究生,于是决定把我送给其他人收养。她坚持我应该被一对念过大学的夫妇收养,所以在我出生的时候,她已经为我被一个律师和他的太太收养做好了所有的准备。但在最后一刻,这对夫妇改了主意,决定收养一个女孩。侯选名单上的另外一对夫妇,也就是我的养父母,在一天午夜接到了一通电话:"有一个不请自来的男婴,你们想收养吗?"他们回答:"当然想。"事后,我的生母才发现我的养母根本就没有从大学毕业,而我的养父甚至连高中都没有毕业,所以她拒绝签署最后的收养文件,直到几个月后,我的养父母保证会把我送到大学,她的态度才有所转变。

17年之后,我真上了大学。但因为年幼无知,我选择了一所和斯坦福一样昂贵的大学,(笑声)我的父母都是工人阶级,他们倾其所有资助我的学业。在6个月之后,我发现自己完全不知道这样念下去究竟有什么用。当时,我的人生漫无目标,也不知道大学对我能起到什么帮助,为了念书,还花光了父母毕生的积蓄,所以我决定退学。我相信车到山前必有路。当时作这个决定的时候非常害怕,但现在回头去看,这是我这一生所作出的最正确的决定之一。(笑声)从我退学那一刻起,我就再也不用去上那些我毫无兴趣的必修课了,我开始旁听那些看来比较有意思的科目。

这件事情做起来一点都不浪漫。因为没有自己的宿舍,我只能睡在朋友房间的地板上;可乐瓶的押金是5分钱,我把瓶子还回去好用押金买吃的;在每个周日的晚上,我都会步行7英里穿越市区,到Hare Krishna教堂吃一顿大餐,我喜欢那儿的食物。我跟随好奇心和直觉所做的事情,事后证明大多数都是极其珍贵的经验。

我举一个例子:那个时候,里德大学提供了全美国最好的书法教育。整个校园的每一张海报,每一个抽屉上的标签,都是漂亮的手写体。由于已经退学,不用再去上那些常规的课程,于是我选择了一个书法班,想学学怎么写出一手漂亮字。在这个班上,我学习了各种衬线和无衬线字体,如何改变不同字体组合之间的字间距,以及如何做出漂亮的版式。那是一种科学永远无法捕捉的充满美感、历史感和艺术感的微妙,我发现这太有意思了.

当时,我压根儿没想到这些知识会在我的生命中有什么实际运用价值;但是10年之后,当我们的设计第一款Macintosh电脑的候,这些东西全派上了用场。我把它们全部设计进了Mac,这是第一台可以排出好看版式的电脑。如果当时我大学里没有旁听这门课程的话,Mac就不会提供各种字体和等间距字体。自从视窗系统抄袭了Mac以后,(鼓掌大笑)所有的个人电脑都有了这些东西。如果我没有退学,我就不会去书法班旁听,而今天的个人电脑大概也就不会有出色的版式功能。当然我在念大学的那会儿,不可能有先见之明,把那些生命中的点点滴滴都串起来;但10年之后再回头看,生命的轨迹变得非常清楚。

再强调一次,你不可能充满预见地将生命的点滴串联起来;只有在你回头看的时候,你才会发现这些点点滴滴之间的联系。所以,你要坚信,你现在所经历的将在你未来的生命中串联起来。你不得不相信某些东西,你的直觉,命运,生活,因缘际会……正是这种信仰让我不会失去希望,它让我的人生变得与众不同。

我的第二个故事是关于爱与失去。

我是幸运的,在年轻的时候就知道了自己爱做什么。在我20岁的时候,就和沃兹在我父母的车库里开创了苹果电脑公司。我们勤奋工作,只用了10年的时间,苹果电脑就从车库里的两个小伙子扩展成拥有4000名员工,价值达到20亿美元的企业。而在此之前的一年,我们刚推出了我们最好的产品Macintosh电脑,当时我刚过而立之年。然后,我就被炒了鱿鱼。一个人怎么可以被他所创立的公司解雇呢?(笑声)这么说吧,随着苹果的成长,我们请了一个原本以为很能干的家伙和我一起管理这家公司,在头一年左右,他干得还不错,但后来,我们对公司未来的前景出现了分歧,于是我们之间出现了矛盾。由于公司的董事会站在他那一边,所以在我30岁的时候,就被踢出了局。我失去了一直贯穿在我整个成年生活的重心,打击是毁灭性的。

在头几个月,我真不知道要做些什么。我觉得我让企业界的前辈们失望了,我失去了传到我手上的指挥棒。我遇到了戴维・帕卡德(普惠的创办人之一――译注)和鲍勃・诺伊斯(英特尔的创办人之一――译注),我向他们道歉,因为我把事情搞砸了。我成了人人皆知的失败者,我甚至想过逃离硅谷。但曙光渐渐出现,我还是喜欢我做过的事情。在苹果电脑发生的一切丝毫没有改变我,一个比特(bit)都没有。虽然被抛弃了,但我的热忱不改。我决定重新开始。

我当时没有看出来,但事实证明,我被苹果开掉是我这一生所经历过的最棒的事情。成功的沉重被凤凰涅�的轻盈所代替,每件事情都不再那么确定,我以自由之躯进入了我整个生命当中最有创意的时期。

在接下来的5年里,我开创了一家叫做NeXT的公司,接着是一家名叫Pixar的公司,并且接识了后来成为我妻子的曼妙女郎。Pixar制作了世界上第一部全电脑动画电影《玩具总动员》,现在这家公司是世界上最成功的动画制作公司之一。(掌声)后来经历一系列的事件,苹果买下了NeXT,于是我又回到了苹果,我们在NeXT研发出的技术在推动苹果复兴的核心动力。我和劳伦斯也拥有了美满的家庭。

我非常肯定,如果没有被苹果炒掉,这一切都不可能在我身上发生。对于病人来说,良药总是苦口。生活有时候就像一块板砖拍向你的脑袋,但不要丧失信心。热爱我所从事的工作,是一直支持我不断前进的惟一理由。你得找出你的最爱,对工作如此,对爱人亦是如此。工作将占据你生命中相当大的一部分,从事你认为具有非凡意义的工作,方能给你带来真正的满足感。而从事一份伟大工作的惟一方法,就是去热爱这份工作。如果你到现在还没有找到这样一份工作,那么就继续找。不要安于现状,当万事了于心的时候,你就会知道何时能找到。如同任何伟大的浪漫关系一样,伟大的工作只会在岁月的酝酿中越陈越香。所以,在你终有所获之前,不要停下你寻觅的脚步。不要停下。

我的第三个故事是关于死亡。

在17岁的时候,我读过一句格言,好像是:"如果你把每一天都当成你生命里的最后一天,你将在某一天发现原来一切皆在掌握之中。"(笑声)这句话从我读到之日起,就对我产生了深远的影响。在过去的33年里,我每天早晨都对着镜子问自己:"如果今天是我生命中的末日,我还愿意做我今天本来应该做的事情吗?"当一连好多天答案都否定的时候,我就知道做出改变的时候到了。

提醒自己行将入土是我在面临人生中的重大抉择时,最为重要的工具。

因为所有的事情――外界的期望、所有的尊荣、对尴尬和失败的惧怕――在面对死亡的时候,都将烟消云散,只留下真正重要的东西。在我所知道的各种方法中,提醒自己即将死去是避免掉入畏惧失去这个陷阱的最好办法。人赤条条地来,赤条条地走,没有理由不听从你内心的呼唤。

大约一年前,我被诊断出癌症。在早晨7:30我做了一个检查,扫描结果清楚地显示我的胰脏出现了一个肿瘤。我当时甚至不知道胰脏究竟是什么。医生告诉我,几乎可以确定这是一种不治之症,顶多还能活3至6个月。大夫建议我回家,把诸事安排妥当,这是医生对临终病人的标准用语。这意味着你得把你今后10年要对你的子女说的话用几个月的时间说完;这意味着你得把一切都安排妥当,尽可能减少你的家人在你身后的负担;这意味着向众人告别的时间到了。

我整天都想着诊断结果。那天晚上做了一个切片检查,医生把一个内诊镜从我的喉管伸进去,穿过我的胃进入肠道,将探针伸进胰脏,从肿瘤上取出了几个细胞。我打了镇静剂,但我的太太当时在场,她后来告诉我说,当大夫们从显微镜下观察了细胞组织之后,都哭了起来,因为那是一非常罕见的,可以通过手术治疗的胰脏癌。我接受了手术,现在已经康复了。

这是我最接近死亡的一次,我希望在随后的几十年里,都不要有比这一次更接近死亡的经历。在经历了这次与死神擦肩而过的经验之后,死亡对我来说只是一项有效的判断工具,并且只是一个纯粹的理性概念时相比,我能够更肯定地告诉你们以下事实:没人想死;即使想去天堂的人,也是希望能活着进去。(笑声)死亡是我们每个人的人生终点站,没人能够成为例外。生命就是如此,因为死亡很可能是生命最好的造物,它是生命更迭的媒介,送走耋耄老者,给新生代让路。现在你们还是新生代,但不久的将来你们也将逐渐老去,被送出人生的舞台。很抱歉说得这么富有戏剧性,但生命就是如此。

你们的时间有限,所以不要把时间浪费在别人的生活里。不要被条条框框束缚,否则你就生活在他人思考的结果里。不要让他人的观点所发出的噪音淹没你内心的声音。最为重要的是,要有遵从你的内心和直觉的勇气,它们可能已知道你其实想成为一个什么样的人。其他事物都是次要的。(超赞的一句话)

在我年轻的时候,有一本非常棒的杂志叫《全球目录》(The Whole Earth Catalog),它被我们那一代人奉为圭臬。这本杂志的创办人是一个叫斯图尔特・布兰德的家伙,他住在Menlo Park,距离这儿不远。他把这本杂志办得充满诗意。那是在60年代末期,个人电脑、桌面发排系统还没有出现,所以出版工具只有打字机、剪刀和宝丽来相机。这本杂志有点像印在纸上的Google,但那是在Google出现的35年前;它充满了理想色彩,内容都是些非常好用的工具和了不起的见解。

斯图尔特和他的团队做了几期《全球目录》,快无疾而终的时候,他们出版了最后一期。那是在70年代中期,我当时处在你们现在的年龄。在最后一期的封底有一张清晨乡间公路的照片,如果你喜欢搭车冒险旅行的话,经常会碰到的那种小路。在照片下面有一排字:物有所不足,智有所不明(Stay Hungry. Stay Foolish.)这是他们停刊的告别留言。物有所不足,智有所不明。我总是以此自诩。现在,在你们毕业开始新生活的时候,我把这句话送给你们。

物有所不足,智有所不明。(Stay Hungry. Stay Foolish.)(另有一译:保持饥饿,保持愚蠢。)

The 2005 Jobs Stanford Commencement Address

I am honored to be with you today at your commencement from one of the
finest universities in the world. I never graduated from college. Truth be
told, this is the closest I've ever gotten to a college graduation. Today
I want to tell you three stories from my life. That's it. No big deal.
Just three stories.

The first story is about connecting the dots.

I dropped out of Reed College after the first six months, but then stayed
around as a drop-in for another 18 months or so before I really quit. So
why did I drop out?

It started before I was born. My biological mother was a young, unwed
college graduate student, and she decided to put me up for adoption. She
felt very strongly that I should be adopted by college graduates, so
everything was all set for me to be adopted at birth by a lawyer and his
wife. Except that when I popped out they decided at the last minute that
they really wanted a girl. So my parents, who were on a waiting list, got
a call in the middle of the night asking: "We have an unexpected baby boy;
do you want him?" They said: "Of course." My biological mother later found
out that my mother had never graduated from college and that my father had
never graduated from high school. She refused to sign the final adoption
papers. She only relented a few months later when my parents promised that
I would someday go to college.

And 17 years later I did go to college. But I naively chose a college that
was almost as expensive as Stanford, and all of my working-class parents'
savings were being spent on my college tuition. After six months, I
couldn't see the value in it. I had no idea what I wanted to do with my
life and no idea how college was going to help me figure it out. And here
I was spending all of the money my parents had saved their entire life. So
I decided to drop out and trust that it would all work out okay. It was
pretty scary at the time, but looking back it was one of the best
decisions I ever made. The minute I dropped out I could stop taking the
required classes that didn't interest me, and begin dropping in on the
ones that looked interesting.

It wasn't all romantic. I didn't have a dorm room, so I slept on the floor
in friends' rooms, I returned Coke bottles for the 5-cent deposits to buy
food with, and I would walk the seven miles across town every Sunday night
to get one good meal a week at the Hare Krishna temple. I loved it. And
much of what I stumbled into by following my curiosity and intuition
turned out to be priceless later on. Let me give you one example:

Reed College at that time offered perhaps the best calligraphy instruction
in the country. Throughout the campus every poster, every label on every
drawer, was beautifully hand calligraphed. Because I had dropped out and
didn't have to take the normal classes, I decided to take a calligraphy
class to learn how to do this. I learned about serif and san serif
typefaces, about varying the amount of space between different letter
combinations, about what makes great typography great. It was beautiful,
historical, artistically subtle in a way that science can't capture, and I
found it fascinating.

None of this had even a hope of any practical application in my life. But
10 years later, when we were designing the first Macintosh computer, it
all came back to me. And we designed it all into the Mac. It was the first
computer with beautiful typography. If I had never dropped in on that
single course in college, the Mac would have never had multiple typefaces
or proportionally spaced fonts. And since Windows just copied the Mac, its
likely that no personal computer would have them. If I had never dropped
out, I would have never dropped in on this calligraphy class, and personal
computers might not have the wonderful typography that they do. Of course
it was impossible to connect the dots looking forward when I was in
college. But it was very, very clear looking backwards 10 years later.

Again, you can't connect the dots looking forward; you can only connect
them looking backwards. So you have to trust that the dots will somehow
connect in your future. You have to trust in something–your gut, destiny,
life, karma, whatever. This approach has never let me down, and it has
made all the difference in my life.

My second story is about love and loss.

I was lucky–I found what I loved to do early in life. Woz and I started
Apple in my parents garage when I was 20. We worked hard, and in 10 years
Apple had grown from just the two of us in a garage into a $2 billion
company with over 4000 employees. We had just released our finest
creation–the Macintosh–a year earlier, and I had just turned 30. And then
I got fired. How can you get fired from a company you started? Well, as
Apple grew we hired someone who I thought was very talented to run the
company with me, and for the first year or so things went well. But then
our visions of the future began to diverge and eventually we had a falling
out. When we did, our Board of Directors sided with him. So at 30, I was
out. And very publicly out. What had been the focus of my entire adult
life was gone, and it was devastating.

I really didn't know what to do for a few months. I felt that I had let
the previous generation of entrepreneurs down–that I had dropped the baton
as it was being passed to me. I met with David Packard and Bob Noyce and
tried to apologize for screwing up so badly. I was a very public failure,
and I even thought about running away from the Valley. But something
slowly began to dawn on me–I still loved what I did. The turn of events at
Apple had not changed that one bit. I had been rejected, but I was still
in love. And so I decided to start over.

I didn't see it then, but it turned out that getting fired from Apple was
the best thing that could have ever happened to me. The heaviness of being
successful was replaced by the lightness of being a beginner again, less
sure about everything. It freed me to enter one of the most creative
periods of my life.

During the next five years, I started a company named NeXT, another
company named Pixar, and fell in love with an amazing woman who would
become my wife. Pixar went on to create the worlds first computer animated
feature film, "Toy Story," and is now the most successful animation studio
in the world. In a remarkable turn of events, Apple bought NeXT, I
returned to Apple, and the technology we developed at NeXT is at the heart
of Apple's current renaissance. And Laurene and I have a wonderful family
together.

I'm pretty sure none of this would have happened if I hadn't been fired
from Apple. It was awful tasting medicine, but I guess the patient needed
it. Sometimes life hits you in the head with a brick. Don't lose faith.
I'm convinced that the only thing that kept me going was that I loved what
I did. You've got to find what you love. And that is as true for your work
as it is for your lovers. Your work is going to fill a large part of your
life, and the only way to be truly satisfied is to do what you believe is
great work. And the only way to do great work is to love what you do. If
you haven't found it yet, keep looking. Don't settle. As with all matters
of the heart, you'll know when you find it. And, like any great
relationship, it just gets better and better as the years roll on. So keep
looking until you find it. Don't settle.

My third story is about death.

When I was 17, I read a quote that went something like: "If you live each
day as if it was your last, someday you'll most certainly be right." It
made an impression on me, and since then, for the past 33 years, I have
looked in the mirror every morning and asked myself: "If today were the
last day of my life, would I want to do what I am about to do today?" And
whenever the answer has been "No" for too many days in a row, I know I
need to change something.

Remembering that I'll be dead soon is the most important tool I've ever
encountered to help me make the big choices in life. Because almost
everything–all external expectations, all pride, all fear of embarrassment
or failure–these things just fall away in the face of death, leaving only
what is truly important. Remembering that you are going to die is the best
way I know to avoid the trap of thinking you have something to lose. You
are already naked. There is no reason not to follow your heart.

About a year ago I was diagnosed with cancer. I had a scan at 7:30 in the
morning, and it clearly showed a tumor on my pancreas. I didn't even know
what a pancreas was. The doctors told me this was almost certainly a type
of cancer that is incurable, and that I should expect to live no longer
than three to six months. My doctor advised me to go home and get my
affairs in order, which is doctor's code for prepare to die. It means to
try to tell your kids everything you thought you'd have the next 10 years
to tell them in just a few months. It means to make sure everything is
buttoned up, so that it will be as easy as possible for your family. It
means to say your goodbyes.

I lived with that diagnosis all day. Later that evening I had a biopsy,
where they stuck an endoscope down my throat, through my stomach and into
my intestines, put a needle into my pancreas and got a few cells from the
tumor. I was sedated, but my wife, who was there, told me that when they
viewed the cells under a microscope the doctors started crying, because it
turned out to be a very rare form of pancreatic cancer that is curable
with surgery. I had the surgery and I'm fine now.

This was the closest I've been to facing death, and I hope its the closest
I get for a few more decades. Having lived through it, I can now say this
to you with a bit more certainty than when death was a useful but purely
intellectual concept:

No one wants to die. Even people who want to go to heaven don't want to
die to get there. And yet death is the destination we all share. No one
has ever escaped it. And that is as it should be, because death is very
likely the single best invention of Life. It is life's change agent. It
clears out the old to make way for the new. Right now the new is you, but
someday not too long from now, you will gradually become the old and be
cleared away. Sorry to be so dramatic, but it is quite true.

Your time is limited, so don't waste it living someone else's life. Don't
be trapped by dogma–which is living with the results of other people's
thinking. Don't let the noise of others' opinions drown out your own inner
voice. And most important, have the courage to follow your heart and
intuition. They somehow already know what you truly want to become.
Everything else is secondary.

When I was young, there was an amazing publication called "The Whole Earth
Catalog," which was one of the bibles of my generation. It was created by
a fellow named Stewart Brand not far from here in Menlo Park, and he
brought it to life with his poetic touch. This was in the late 1960's,
before personal computers and desktop publishing, so it was all made with
typewriters, scissors, and polaroid cameras. It was sort of like Google in
paperback form, 35 years before Google came along: It was idealistic, and
overflowing with neat tools and great notions.

Stewart and his team put out several issues of "The Whole Earth Catalog,"
and then when it had run its course, they put out a final issue. It was
the mid-1970s, and I was your age. On the back cover of their final issue
was a photograph of an early morning country road, the kind you might find
yourself hitchhiking on if you were so adventurous. Beneath it were the
words: "Stay Hungry. Stay Foolish." It was their farewell message as they
signed off. Stay Hungry. Stay Foolish. And I have always wished that for
myself. And now, as you graduate to begin anew, I wish that for you.

Stay Hungry. Stay Foolish.

Thank you all very much.

linux下批量缩小图片

用到了 ImageMagick 工具包。
@ Ubuntu
sudo apt-get install imagemagick

引用
$ convert -resize 50%x50% 1.jpg 1_small.jpg
就可以把 1.jpg 的尺寸缩小到越来的1/4
引用
$ convert -sample 400x300 1.jpg 1_small.jpg
就可以把 1.jpg 的尺寸缩小到400x300
注意,两个比率/数字之间的是字母x,不是乘号。

然后来个批量转换的东东(网上的教程是for,虽然我比较喜欢find)
引用
for img in `ls *.jpg`; do convert -resize 50%x50% $img small_$img; done

如果要递归地转换当前目录以及子目录的图像就用find吧:
引用
find -name "*.jpg" -exec convert -resize 50%x50% {} {}.small.jpg

Linux下批量改变图片

周末出去玩,照了几张数码相片。上传到网上之前需要缩小一下,以前在Windows里都是用"光影魔术手",在Linux下如何完成这个工作呢?我开始是用GIMP一张的转,但太麻烦了,GIMP支持批处理脚本的,Google要害词"gimp-image-scale"可以找到一些这方面的脚本。不过更方便的是用Image
Magick这个命令行图像处理软件

先用如下命令装上Image Magick:

sudo apt-get install imagemagick

缩图方法一:convert -resize 50%x50% photos\*.JPG small\

这种方法转成的图片的文件名变成了数字,假如希望原文件名不变,可以用如下命令(实际上是一个四行合为一行的脚本)。

缩图方法二:for img in `ls photos\*.JPG`; do convert -resize 50%x50% $img
small-$img; done

感觉要比如以前Windows下的软件方便多了。

注:我之前曾象资料里用-sample参数,而非-resize。但前者可能不仅缩放了大小,还压缩了图像,所以我对缩小后的图片质量不太满足。用convert
-h可以显示其所有参数,我后来选用了-resize。

后续。。。

过了两天,我看到一篇文章,ubuntu自带的gThumb也可以缩小图片的。我一看,果然。它是界面操作,感觉还是没有convert的命令行来得快。不过,如果你只是偶然缩小一下图片,也就不必去装其他软件了,就用自带的gThumb好了。使用方法如下:

启动:我习惯进入到图片目录(我装了一个快速进入终端的右键菜单),然后用命令行启动:
gthumb
*.JPG。这样一启动gthumb所有图片都在那了。当然,也可以用主菜单"应用程序->图像->gThumb图像浏览器"来启动,再选择图片。

全选所有图片,然后"工具->scale
images....",重选一个保存目标。接下去就不用说了。

Ubuntu论坛的原文资料复制如下:

mage MagicK 是一个强盛的图象处理工具包。它提供了几个非常方便的命令行命令:
display animateimport
montagemogrifyidentify等,可以进行图象的显示,缩放,旋转,调色,加框,加注释等,还能制作GIF动画,图象索引,能自动生成图象.

1. 制作索引图和动画

!/bin/bash

montage -bordercolor red -borderwidth 3 -label "%f" -tile 5x3 *.JPG
montage.jpg

mogrify -format gif *.JPG

display montage.jpg

animate *.JPG

2. 缩放 convert -sample 80x40 input.jpg output.jpg
#注重:缩放后图像保持原来的长宽比例 convert -sample 25%x25% input.jpg
output.jpg

3. 为当前目录的所有图像生成缩略图

for img in `ls *.jpg`

do

convert -sample 25%x25% $img thumb-$img

done

4. 获取文件信息 libtiff

tiffinfo filename.tiff

pnginfo filename.png

5. 可以使用 ImageMagick 的 identify

identify -verbose sample.png

identify -format "%wx%h" sample.png

6. 旋转图像

convert -rotate 90 input.jpg output.jpg

7. 更改文件类型

convert input.jpg output.png

8. 为图像增加注释文字

convert -font helvetica -fill white -pointsize 36 \

-draw 'text 1050 "Floriade 2002 Canberra Australia"' \

floriade.jpg comment.jpg

convert -font fonts/1900805.ttf -fill white -pointsize 36 \

-draw 'text 10475 "stillhq.com"' \

floriade.jpg stillhq.jpg

9. 特别效果

convert -charcoal 2 input.jpg output.jpg #炭笔

convert -colorize 255 input.jpg output.jpg #着色 可以指定三种颜色
red/green/blue

convert -implode 4 input.jpg output.jpg #内爆效果

convert -solarize 42 input.jpg output.jpg #曝光,模仿胶片曝光

convert -spread 5 input.jpg output.jpg #随机移动,参数是位移大小

10. 一次执行多个操作

convert -sample 25%x25% -spread 4 -charcoal 4 input.jpg output.jpg