liamtoney / sonify

Sonification of seismic and infrasound signals
https://sonify.rtfd.io
MIT License
32 stars 2 forks source link

Improve handling of resolution #4

Closed liamtoney closed 2 years ago

liamtoney commented 2 years ago

Currently we specify a RESOLUTION (e.g. (3840, 2160) for 4K) and DPI (e.g. 500) and use

Figure(figsize=np.array(RESOLUTION) / DPI)

to ensure that the output RESOLUTION is achieved.

A better solution would be to have the user specify the RESOLUTION only and have the DPI be a variable quantity that is altered such that RESOLUTION is achieved for a fixed figsize. In other words, we should ensure that altering the RESOLUTION does not change the size of figure elements — it should only change how pixelated the frames are.

This would open up the door to providing users with a 2K and/or 1080p option along with 4K. This would be useful, since when combined with 60fps, 4K can sometimes produce videos with bitrates high enough to cause playback issues.

liamtoney commented 2 years ago

The line https://github.com/liamtoney/sonify/blob/f467ae1b3d2912fdfa2fdf395e050f0df7fc269c/sonify/sonify.py#L386 will need to be re-thought if we're changing resolution, along with any other tweaks that rely on pixel units!