Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Bug]: The default animation.convert_args of ["-layers", "OptimizePlus"] breaks non-gif output #24268

Open
@joh

Description

@joh

Bug summary

PR#23371 changed the defaultanimation.convert_args to["-layers", "OptimizePlus"] in order to better compress gif animations. However,animation.convert_args is also used byImageMagickFileWriter to save frames as individual images (e.g., as png). Using-layers OptimizePlus in this case causes unintended cropping for some of the frames!

Code for reproduction

frommatplotlibimportanimationfig,ax=plt.subplots()x=np.arange(0,2*np.pi,0.01)line,=ax.plot(x,np.sin(x))defanimate(i):line.set_ydata(np.sin(x+i/10.0))# update the datareturnline,ani=animation.FuncAnimation(fig,animate,np.arange(1,10),init_func=None,interval=25)Writer=animation.writers['imagemagick_file']writer=Writer()#writer = Writer(extra_args=[]) # Workaround to disable -layers OptimizePlusani.save('ani.png',writer=writer)

Actual outcome

Frame (ani-0.png) 0 is correct, while frames 1-8 (ani-1.png through ani-8.png) are cropped.

Expected outcome

None of the frames should be cropped in the resulting images. See commented workaround in above code example.

Additional information

No response

Operating system

No response

Matplotlib Version

3.6.1

Matplotlib Backend

No response

Python version

No response

Jupyter version

No response

Installation

pip

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp