Commit Graph

46 Commits

Author SHA1 Message Date
wiredfool
30631902d6 Merge pull request #1231 from radarhere/image_palette
Copy image when saving in GifImagePlugin
2015-06-16 11:49:41 -07:00
Andrew Murray
ecb1cef99b Added background color index saving to GifImagePlugin 2015-06-11 11:10:05 +10:00
Andrew Murray
42d1aabcc4 Removed interlace flag from GifImagePlugin getdata 2015-06-09 20:21:00 +10:00
Antony Lee
1b80fe5507 Provide n_frames attribute to multi-frame formats.
cf #1190, #1192.  Tests missing.
2015-06-08 00:40:23 +10:00
Hugo
b816c048ad Merge pull request #1172 from radarhere/gif
Added duration and loop set to GifImagePlugin
2015-06-04 13:07:58 +03:00
Andrew Murray
3c7e37d2d7 Replaced old-style classes 2015-05-27 00:07:21 +10:00
Andrew Murray
ca89d431ba To avoid modifications, copy image when saving in GifImagePlugin 2015-05-13 16:39:25 +10:00
Andrew Murray
f028928b5a Rearranged used_palette_colors to fix get_local_header 2015-04-24 00:44:27 +10:00
Andrew Murray
aa1368f551 Flake8 fixes 2015-04-23 23:41:42 +10:00
Andrew Murray
a5917b3fa3 Added GifImagePlugin tests 2015-04-04 11:45:30 +11:00
Andrew Murray
ecebedba7f Added loop set to GifImagePlugin 2015-04-04 10:33:35 +11:00
Andrew Murray
e36e7dd7a2 Added duration set to GifImagePlugin 2015-04-04 10:33:35 +11:00
hugovk
2879819ce7 Style/health fixes 2015-04-01 16:47:01 +03:00
Moriyoshi Koizumi
9d60085957 The optimization algorithm is only applicable to the image of mode="P" or "L". 2014-11-06 21:29:27 +09:00
hugovk
8de95676e0 flake8 2014-08-26 16:47:10 +03:00
Nikita Uvarov
97e111d079 Fixed wrong mode of gif image.
In case of L mode and small image.
2014-08-07 16:23:08 +03:00
Lars Jørgen Solberg
925277cbfc ensure that the prevous frame was loaded when seek()ing 2014-07-07 20:46:54 +02:00
Lars Jørgen Solberg
047832c6c6 only update the disposal_method if it not 'unspecified' 2014-07-03 19:01:18 +02:00
Lars Jørgen Solberg
f88a355c6c Handle transparency between frames for animated GIFs
Show the previous frame for transparent pixels when the disposal method is 'do not dispose'.

This fixes issue 634.
2014-07-03 18:53:21 +02:00
Lars Jørgen Solberg
08a9bdbcd6 Fix dispose calculations
- use correct dispose mode
- only apply the dispose on extent of the previous frame
2014-07-02 21:27:52 +02:00
wiredfool
b981ef425b Suppress stderr from ppmquant and ppmtogif 2014-06-29 14:24:32 -07:00
Michael Brown
a301d061fb Better error checking in _save_netpbm 2014-06-27 19:07:20 -04:00
Michael Brown
34317edd8a Change most uses of os.system to use subprocess
The only places left that use os.system are in ImageShow and setup.py
2014-06-27 19:07:20 -04:00
wiredfool
a77ee2d8c5 Fix test failure when optimizing the palette on mode L gifs 2014-03-04 21:44:32 -08:00
David Schmidt
93a8bc9bd3 * fix palette handling for converted gifs
* fix gif optimization
* better auto convert paramter for gif save
2014-03-04 21:44:32 -08:00
David Schmidt
9d43f156a8 replace custom search with dict in gif optimize 2013-08-06 11:36:02 +02:00
David Schmidt
c9df9d0b23 reorganized gif optimize to work with palette parameter 2013-08-05 17:59:35 +02:00
David Schmidt
b9ab3f5bf4 fix Issue #312
improve palette handling while saving gif and png
2013-08-02 16:32:49 +02:00
Alex Clark
bb1b3a532c Cleanup WS, courtesy of @Arfrever
find * -type f "-(" -name "*.bdf" -o -name "*.c" -o -name "*.h" -o -name "*.py" -o -name "*.rst" -o -name "*.txt" "-)" -exec sed -e "s/[[:space:]]*$//" -i {} \;
2013-06-30 18:42:19 -04:00
David Schmidt
b66d888b0e adjust the transparency index after successful optimize
skip transparency block if transparent color is not used after optimize
2013-05-24 13:12:40 +02:00
David Schmidt
71b30352d9 limit custom palette size 2013-05-24 13:16:16 +03:00
David Schmidt
a9cb1281f4 fix Python 2 compatibility 2013-05-24 11:55:31 +02:00
David Schmidt
12cea19280 a break 2013-05-23 15:45:11 +02:00
David Schmidt
dad5e86226 fix gif test, fix gif optimization for palette length < 3 2013-05-23 15:24:06 +02:00
David Schmidt
5cd1b9f01e minor addition 2013-05-23 14:31:48 +02:00
David Schmidt
a466b3e099 fixes #211
replace the gif optimization with a working version
2013-05-23 14:06:09 +02:00
Alex Clark
3020c16eaa Fix imports 2013-03-07 11:20:28 -05:00
Alex Clark
cb4f0f2b3c Revert "Fix saving images with added transparency"
This reverts commit cc439099c1.
2013-02-06 09:25:03 -05:00
Sandro Mani
cc439099c1 Fix saving images with added transparency
See http://mail.python.org/pipermail/image-sig/1999-February/000648.html
This patch was carried by fedora for python-imaging
2013-02-06 00:49:26 +01:00
David Schmidt
ee04c7ceea Fixed another difference between PIL and Pillow 2013-01-11 13:24:44 +01:00
d-schmidt
900f3a8ff7 Added possibility to save gifs with a custom palette when using color mode P 2013-01-10 20:34:58 +01:00
Brian Crowell
a7e3b2e47b py3k: The big push
There are two main issues fixed with this commit:

* bytes vs. str: All file, image, and palette data are now handled as
  bytes. A new _binary module consolidates the hacks needed to do this
  across Python versions. tostring/fromstring methods have been renamed to
  tobytes/frombytes, but the Python 2.6/2.7 versions alias them to the old
  names for compatibility. Users should move to tobytes/frombytes.

  One other potentially-breaking change is that text data in image files
  (such as tags, comments) are now explicitly handled with a specific
  character encoding in mind. This works well with the Unicode str in
  Python 3, but may trip up old code expecting a straight byte-for-byte
  translation to a Python string. This also required a change to Gohlke's
  tags tests (in Tests/test_file_png.py) to expect Unicode strings from
  the code.

* True div vs. floor div: Many division operations used the "/" operator
  to do floor division, which is now the "//" operator in Python 3. These
  were fixed.

As of this commit, on the first pass, I have one failing test (improper
handling of a slice object in a C module, test_imagepath.py) in Python 3,
and three that that I haven't tried running yet (test_imagegl,
test_imagegrab, and test_imageqt). I also haven't tested anything on
Windows. All but the three skipped tests run flawlessly against Pythons
2.6 and 2.7.
2013-01-10 08:46:56 -06:00
Brian Crowell
31c454b925 py3k: 2to3's "idiom" filter
This is, I guess, a few things the Python devs were just fed up with.

* "while 1" is now "while True"
* Types are compared with isinstance instead of ==
* Sort a list in one go with sorted()

My own twist is to also replace type('') with str, type(()) with tuple,
type([]) with list, type(1) with int, and type(5000.0) with float.
2013-01-10 08:46:53 -06:00
Brian Crowell
83ff0b3b31 py3k: Use relative imports
In py3k, imports are absolute unless using the "from . import" syntax.

This commit also solves a recursive import between Image, ImageColor, and
ImagePalette by delay-importing ImagePalette in Image.

I'm not too keen on this commit because the syntax is ugly. I might go back
and prefer the prettier "from PIL import".
2013-01-10 08:46:48 -06:00
Brian Crowell
78575798d7 py3k: Update exception usage to modern syntax 2013-01-10 08:46:33 -06:00
Alex Clark
9a640e3157 Forking PIL 2010-07-30 22:52:47 -04:00