eelbrain.fmtxt.Image

class eelbrain.fmtxt.Image(name=None, format='png', alt=None, buf=b'', height=None, width=None)

Represent an image file

Methods

close()

Disable all I/O operations.

copy_pdf()

Copy PDF to clipboard

copy_tex()

Copy TeX to clipboard

detach()

Disconnect this buffer from its underlying raw stream and return it.

fileno()

Return underlying file descriptor if one exists.

flush()

Does nothing.

from_array(array[, name, format, alt, ...])

Create an Image object from an array.

from_file(path[, name, alt])

Create an Image object from an existing image file.

get_html([env])

Complete HTML representation

get_rtf([env])

get_str([env])

String representation

get_tex(env)

TeX representation

getbuffer()

Get a read-write view over the contents of the BytesIO object.

getvalue()

Retrieve the entire contents of the BytesIO object.

isatty()

Always returns False.

read([size])

Read at most size bytes, returned as a bytes object.

read1([size])

Read at most size bytes, returned as a bytes object.

readable()

Returns True if the IO object can be read.

readinto(buffer, /)

Read bytes into buffer.

readinto1(buffer, /)

readline([size])

Next line from the file, as a bytes object.

readlines([size])

List of bytes objects, each a line from the file.

save_html([path, embed_images, meta])

Save in HTML format

save_image(dst)

save_pdf([path])

Save in PDF format

save_rtf([path])

Save in Rich Text format

save_tex([path])

Save in TeX format

save_txt([path])

Save as plain text file

seek(pos[, whence])

Change stream position.

seekable()

Returns True if the IO object can be seeked.

tell()

Current file position, an integer.

truncate([size])

Truncate the file to at most size bytes.

writable()

Returns True if the IO object can be written.

write(b, /)

Write bytes to file.

writelines(lines, /)

Write lines to the file.