Hi Husman,

A little piece of code to use an intermediate morph that has not a transparency 
background. When the morph is exported, the JPEG file is correct.

|window m graph |
window := ESExamples new kiviat2.

graph := window model canvas imageForm asMorph.
m := Morph new extent: graph extent; color: Color white.
m addMorph: graph; position: 1@1.
m imageForm writeJPEGfileNamed: 'test.jpg'

We can probably do best

Hope that can help you
Olivier ;-)


Le 16 juin 2013 à 09:49, Usman Bhatti a écrit :

> On Sun, Jun 16, 2013 at 12:00 AM, Benjamin 
> <benjamin.vanryseghem.ph...@gmail.com> wrote:
> use png.
> 
> Jpegs have background, so you will not go very further in this direction (if 
> I understood well your problem ^^)
> 
> The thing is that I am using Artefact framework for PDF images and it uses 
> JPEG plugin for embedding images. Earlier, I tried with exporting PNGs (that 
> have a transparent background) but when importing these PNGs into pdf docs, 
> the JPEGReader adds the colored background (black in my case).
> 
> Another solution would be to see if Artefact can allow embedding Forms in 
> Pharo into PDF docs directly (currently it does not) or it can provide a 
> plugin for PNG images.
> 
> 
>  
> 
> Ben
> 
> On Jun 15, 2013, at 11:56 PM, Usman Bhatti <usman.bha...@gmail.com> wrote:
> 
>> I need to export JPEG images in Pharo to later import then in my PDF 
>> document. When I export JPEG files with Pharo, the background is black, 
>> which makes the exported image meaningless. To reproduce the problem, do the 
>> following in the latest moose image (the image can be obtained from here):
>> 
>> |window|
>> window := ESExamples new kiviat2.
>> window model canvas imageForm writeJPEGfileNamed: 'fileName.jpg'. 
>> 
>> The file will be produced in the image folder. If someone could suggest how 
>> to make the background white or transparent, it'll be a great help.
>> 
>> Usman
> 
> 

Reply via email to