pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/matplotlib/matplotlib/commit/9c79686a3081f9928daedaeac423058a8ab1483d

gin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/global-7a1ad343bd40328c.css" /> Deprecate tostring_rgb. · matplotlib/matplotlib@9c79686 · GitHub
Skip to content

Commit 9c79686

Browse files
committed
Deprecate tostring_rgb.
As noted previously, silently dropping alpha can be confusing. Also, directly accessing the buffer array is more efficient (it does not involve copying to a string buffer) and should cover most use cases.
1 parent 9700f74 commit 9c79686

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
``RendererAgg.tostring_rgb`` and ``FigureCanvasAgg.tostring_rgb``
2+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3+
... are deprecated with no replacement.

lib/matplotlib/backends/backend_agg.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,7 @@ def buffer_rgba(self):
280280
def tostring_argb(self):
281281
return np.asarray(self._renderer).take([3, 0, 1, 2], axis=2).tobytes()
282282

283+
@_api.deprecated("3.8")
283284
def tostring_rgb(self):
284285
return np.asarray(self._renderer).take([0, 1, 2], axis=2).tobytes()
285286

@@ -414,6 +415,7 @@ def get_renderer(self, cleared=False):
414415
self.renderer.clear()
415416
return self.renderer
416417

418+
@_api.deprecated("3.8")
417419
def tostring_rgb(self):
418420
"""
419421
Get the image as RGB `bytes`.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy