# Images in Ruby

**URL:** <https://rubytalk.org/t/images-in-ruby/10431>\
**Category:** ruby-talk\
**Created:** [5 March 2004 15:54 UTC](https://rubytalk.org/t/images-in-ruby/10431 "2004-03-05T15:54:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Peefh](https://avatars.discourse-cdn.com/v4/letter/p/f1d935/32.png) [@Peefh](https://rubytalk.org/u/Peefh)\
**Post date:** [5 March 2004 15:54 UTC](https://rubytalk.org/t/images-in-ruby/10431/1 "2004-03-05T15:54:42Z")

</div>

Images in Ruby

> **···**
>
> ==============
> 
> A few days ago, I asked a question about using .PNG Images in a Ruby/Tk  
> environnement, but I forgot to give some data.
> 
> - What I have: WinXP Home SP1, Ruby 1.8.0, Tk8.3, _no_ compiler.
> 
> - What I’d like to do: to use a “.PNG” TkPhotoImage to show it as  
> TkcImage in a TkCanvas.
> 
> I’m playing with 640x640 pictures (256 colors), for whitch the sizes  
> are about:  
> .BMP (windows) -\> 410 Kb  
> .PNG -\> 120 Kb  
> .PPM -\> 1200 Kb  
> I have to use hundreds of them…
> 
> Somebody suggested me to use “GD”, whitch is a good tool for using  
> …PNG/.JPG but from whitch I cannot build any TkPhotoImage(s), or whitch  
> I _don’t know_ how to use in TkCanvas.
> 
> Did someone try to do that?  
> Thank you.
> 
> –  
> Ceci est une signature automatique de MesNews.  
> Site : [http://mesnews.no-ip.com](http://mesnews.no-ip.com)

---

<div class="post-metadata">

**Author:** ![Peefh](https://avatars.discourse-cdn.com/v4/letter/p/f1d935/32.png) [@Peefh](https://rubytalk.org/u/Peefh)\
**Post date:** [9 March 2004 19:44 UTC](https://rubytalk.org/t/images-in-ruby/10431/2 "2004-03-09T19:44:39Z")

</div>

Peefh a exprimé avec précision :

> # Images in Ruby
> 
> A few days ago, I asked a question about using .PNG Images in a Ruby/Tk  
> environnement, but I forgot to give some data.
> 
> - What I have: WinXP Home SP1, Ruby 1.8.0, Tk8.3, _no_ compiler.
> 
> - What I’d like to do: to use a “.PNG” TkPhotoImage to show it as TkcImage in  
> a TkCanvas.
> 
> I’m playing with 640x640 pictures (256 colors), for whitch the sizes are  
> about:  
> .BMP (windows) → 410 Kb  
> .PNG → 120 Kb  
> .PPM → 1200 Kb  
> I have to use hundreds of them…
> 
> Somebody suggested me to use “GD”, whitch is a good tool for using .PNG/.JPG  
> but from whitch I cannot build any TkPhotoImage(s), or whitch I _don’t know_  
> how to use in TkCanvas.
> 
> Did someone try to do that?  
> Thank you.

Eureka!  
I store files in .png format, and I transform in .ppm format just  
before use… No other way ☹

> **···**
>
> –  
> Ceci est une signature automatique de MesNews.  
> Site : [http://mesnews.no-ip.com](http://mesnews.no-ip.com)
