[script] resize image in pourcent

ForumsFor GIMP users ► [script] resize image in pourcent

Sent: 2009-07-04 13:20:45 UTC (over 2 years ago)

From: Didier Bretin

[script] resize image in pourcent

Hi,

I'm improving my script, and I would like to use the function
gimp-image-scale and specify widht and height in pourcent, not in pixel.

Do you know how I can specify pourcent ?

Regards.

--
Didier Bretin
http://bretin.net/
http://twitter.com/didier69
_______________________________________________
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user

Reply to this message

Sent: 2009-07-04 17:58:55 UTC (over 2 years ago)

From: saulgoode@flashingtwelve.brickfilms.com

[script] resize image in pourcent

Quoting Didier Bretin :

> I'm improving my script, and I would like to use the function
> gimp-image-scale and specify widht and height in pourcent, not in pixel.
>
> Do you know how I can specify pourcent ?

You need to calculate the pixel values manually.

(gimp-image-scale image
(* (car (gimp-image-width image)) x-pct 0.01)
(* (car (gimp-image-height image)) y-pct 0.01)
)

_______________________________________________
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user

Reply to this message

Sent: 2009-07-05 08:25:57 UTC (over 2 years ago)

From: Didier Bretin

[script] resize image in pourcent

saulgoode@flashingtwelve.brickfilms.com wrote:
> Quoting Didier Bretin :
>
>> I'm improving my script, and I would like to use the function
>> gimp-image-scale and specify widht and height in pourcent, not in pixel.
>>
>> Do you know how I can specify pourcent ?
>
> You need to calculate the pixel values manually.
>
> (gimp-image-scale image
> (* (car (gimp-image-width image)) x-pct 0.01)
> (* (car (gimp-image-height image)) y-pct 0.01)
> )

Yes ! Great, it works.

Thank you for your help.

--
Didier Bretin
http://bretin.net/
http://twitter.com/didier69
_______________________________________________
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user

Reply to this message

Welcome!


Lost password?

Not a member? Sign up!

Random tutorials | Latest tutorials

  1. Cool glowing text Cool glowing text 40
  2. Smelting text / Creating blood text Smelting text / Creating blood text 37
  3. Crazy Ions Crazy Ions 4
  4. "Solar winds" graphics effect "Solar winds" graphics effect 7

Latest comments

A facebook page, could be great too! (about 14 hours ago in GIMP gets closer to the community with Google+!)

bah just use 2.7.4 (or 2.7.5 on Windows) (about 17 hours ago in Last stable 2.6 release: 2.6.12 has arrived)

Hmm, would prefer Diaspora, I don't use G+ myself, but I guess it h... (about 17 hours ago in GIMP gets closer to the community with Google+!)

Poll

Is GIMP an adequate application for you to create printed graphics like flyers, advertisments etc?

Latest forum activities

Your Ad Here

facts & numbers

gimpusers.com RSS feed

48 identi.ca followers
745 Twitter followers

powered by bitfire it services