473,397 Members | 1,960 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

wx and pil conversion

A little problem.

Can I directly show Pil objects "image.open("bla.jpg") in Wx or do I
have to transform them.

If I have to transofm them How can I do it. Pixel by pixel or is there
somethin built in in pil or wx or python.
pilj->wx and wx->pil.

Mar 13 '08 #1
4 1476
azrael wrote:
A little problem.

Can I directly show Pil objects "image.open("bla.jpg") in Wx or do I
have to transform them.

If I have to transofm them How can I do it. Pixel by pixel or is there
somethin built in in pil or wx or python.
pilj->wx and wx->pil.
PIL doesn't depend on wx, so if anything then wx knows about PIL. But I
doubt it. Instead, use cStringIO and save a PIL-Image to memory, then use
that as file-argument to something that works for wx - no idea what, but
there should be means to load JPEGs and so forth.

If file-objects aren't enough, create a temp-file. No, that's not to slow.

Diez
Mar 13 '08 #2
I thought of using Temp files but I am afraid of the JPG destorsion
while saving because of the compresion.I am looking for a way to
directly transform it.

On Mar 13, 5:09*pm, "Diez B. Roggisch" <de...@nospam.web.dewrote:
azrael wrote:
A little problem.
Can I directly show Pil objects "image.open("bla.jpg") in Wx or do I
have to transform them.
If I have to transofm them How can I do it. Pixel by pixel or is there
somethin built in in pil or wx or python.
pilj->wx and wx->pil.

PIL doesn't depend on wx, so if anything then wx knows about PIL. But I
doubt it. Instead, use cStringIO and save a PIL-Image to memory, then use
that as file-argument to something that works for wx - no idea what, but
there should be means to load JPEGs and so forth.

If file-objects aren't enough, create a temp-file. No, that's not to slow.

Diez
Mar 13 '08 #3
azrael wrote:
I thought of using Temp files but I am afraid of the JPG destorsion
while saving because of the compresion.I am looking for a way to
directly transform it.
Then don't use JPEG, use PNG. It's lossless.

Diez
Mar 13 '08 #4
On Mar 13, 6:57*pm, "Diez B. Roggisch" <de...@nospam.web.dewrote:
azrael wrote:
I thought of using Temp files but I am afraid of the JPG destorsion
while saving because of the compresion.I am looking for a way to
directly transform it.

Then don't use JPEG, use PNG. It's lossless.

Diez
thnx. i did't think about that. i totaly forgot png.
Mar 13 '08 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Stub | last post by:
Docs says that "The compiler does not use an explicit constructor to implement an implied conversion of types. It's purpose is reserved explicitly for construction." I put up code of three cases...
7
by: Michael Lehn | last post by:
Hi, I have a question regarding the conversion of objects. When is the conversion done by the constructor and when by the operator. My feeling tells me that the constructor is preferred. But...
16
by: TTroy | last post by:
Hello, I'm relatively new to C and have gone through more than 4 books on it. None mentioned anything about integral promotion, arithmetic conversion, value preserving and unsigned preserving. ...
31
by: Bjørn Augestad | last post by:
Below is a program which converts a double to an integer in two different ways, giving me two different values for the int. The basic expression is 1.0 / (1.0 * 365.0) which should be 365, but one...
11
by: Steve Gough | last post by:
Could anyone please help me to understand what is happening here? The commented line produces an error, which is what I expected given that there is no conversion defined from type double to type...
2
by: Alex Sedow | last post by:
Why explicit conversion from SomeType* to IntPtr is not ambiguous (according to standart)? Example: // System.IntPtr class IntPtr { public static explicit System.IntPtr (int); public...
3
by: Steve Richter | last post by:
here is a warning I am getting in a C++ .NET compile: c:\SrNet\jury\JuryTest.cpp(55) : warning C4927: illegal conversion; more than one user-defined conversion has been implicitly applied while...
0
by: Lou Evart | last post by:
DOCUMENT CONVERSION SERVICES Softline International (SII) operates one of the industry's largest document and data conversion service bureaus. In the past year, SII converted over a million...
0
by: dataentryoffshore | last post by:
Get a Discount up to 60% on data entry, data capture, dataentry services, large volume data processing and data conversion services through offshore facilities in India. Offshore data entry also...
21
by: REH | last post by:
It it permissible to use the constructor style cast with primitives such as "unsigned long"? One of my compilers accepts this syntax, the other does not. The failing one chokes on the fact that the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.