Skip to content

Releases

1.2.0

Choose a tag to compare

@076923 076923 released this 15 Nov 11:48
  • Fixed: thumbnails and the hover rendered RGB arrays with OpenCV (BGR) when cv2 was installed, so colors were swapped. New setting pythonImagePreview.arrayRenderer (default matplotlib) picks the renderer used first for plain arrays
  • Grid renderer: every item of a batch (N×C×H×W, N×H×W×C) tiled into one image, offered for arrays and tensors with 4 dimensions
  • Inspector: a viewer with zoom and pan, the value of the pixel under the cursor, R/G/B/A/gray channel toggles and a histogram. Open it from [Inspect] at the bottom of the Quick Fix menu, Inspect Image in the Variables view's context menu or the hover's Inspect link, make it the default with pythonImagePreview.viewer, or right-click an image file in the Explorer
  • Hover and thumbnail tooltips show min, max and mean next to the shape and dtype
  • Ctrl+Alt+P (macOS ⌘+Alt+P) previews the variable at the cursor or the selection with the first applicable renderer, without a menu (Preview Image with Default Renderer, also in the editor context menu)
  • Thumbnails are rendered at reduced size in the debugged process (arrays are subsampled, figures saved at a lower dpi, Pillow images shrunk), so stepping through functions with large images stays fast; the full-size file is written only when a preview is opened
  • New object types: xarray DataArray, dask Array, OpenCV UMat, torchvision Image/Mask/Video tv_tensors
  • Command titles and setting descriptions are localized; Korean is included (package.nls.ko.json)

1.1.0

Choose a tag to compare

@076923 076923 released this 15 Nov 11:48
  • Renderers are only probed (importlib.util.find_spec) when the Quick Fix menu opens; the image is rendered when you pick one. Hovering the lightbulb no longer writes files or imports libraries in the debugged process, and failures now show an error with a Show Log button
  • Libraries that share a type name (PIL and SimpleITK Image, Matplotlib/Plotly and Bokeh Figure) are told apart by module, so only the renderer that applies is offered
  • Hovering an image-like variable with Alt held while paused shows its type, shape and dtype with a thumbnail and links to open the full preview (pythonImagePreview.hoverPreview, pythonImagePreview.hoverThumbnailWidth, pythonImagePreview.hoverThumbnailHeight)
  • Inline thumbnails: each visible mention of an image-like local variable gets a small thumbnail before its name; hovering it shows the larger preview and renderer links without holding Alt (pythonImagePreview.inlineThumbnails, pythonImagePreview.inlineThumbnailHeight, pythonImagePreview.inlineThumbnailLimit)
  • Inline Values: lines mentioning an image-like local variable show img: (480, 640, 3) uint8 at their end. pythonImagePreview.inlineValues chooses between images (image-like variables only), all (other variables show their value too, except modules, functions and classes) and off (default)
  • Python Image Preview: Open Settings command
  • Preview Image in the Variables view context menu; asks for the renderer if several apply
  • A selected expression (img[..., 0], batch[0], self.model.weight) can be previewed, not only the word under the cursor
  • Uses the frame selected in the Call Stack view instead of always the top frame of the first stopped thread
  • New setting pythonImagePreview.grayscaleColormap (default gray); 2-D arrays rendered with Matplotlib were previously saved with viridis
  • Fixed: uint16 arrays were clipped to white and negative floats (-1..1 tensors) to black; both are now min-max scaled. NaN is mapped to 0
  • Fixed: float16/bfloat16 PyTorch tensors failed to convert
  • Fixed: masked entries of MaskedArray showed their raw values; they are filled with 0
  • Fixed: preview files were deleted when a debug session of another language ended

1.0.0

Choose a tag to compare

@076923 076923 released this 15 Nov 11:48

First stable release.

  • Modernized build: esbuild bundle, TypeScript 5, ESLint 9, VS Code ^1.90
  • Activates for the debugpy debug type as well as python; fixes the crash on running threads in recent VS Code and the "command not found" error
  • Runs where the debugger runs, so Remote-SSH / WSL / Dev Containers work
  • Preview images are written under the OS temp directory (configurable via pythonImagePreview.cacheDirectory) instead of __pycache__/preview next to the source file, and are removed when the debug session ends
  • Variables are also resolved from the Globals scope
  • New libraries: JAX, CuPy, pandas (DataFrame/Series via .plot()), SimpleITK, nibabel, Bokeh (needs selenium or playwright), Altair (needs vl-convert-python)
  • Matplotlib Axes/SubFigure and seaborn FacetGrid/PairGrid/JointGrid can be previewed (resolved to their figure)
  • Arrays and tensors are normalized before saving: batch dimension dropped, CHW → HWC, single channel squeezed, bool/uint16/float ranges mapped to uint8
  • No longer imports matplotlib.pyplot inside the debuggee, so the matplotlib.use("Agg") workaround is not needed and the user's backend is left untouched
  • Python errors inside the debuggee are caught and logged to the "Python Image Preview" output channel instead of failing silently
  • PyTorch tensors on any device are previewed via .detach().cpu()
  • Commands: Python Image Preview: Preview Image at Cursor (also in the editor context menu while debugging), Python Image Preview: Clear Preview Cache
  • Settings: pythonImagePreview.cacheDirectory (supports ${workspaceFolder}, ${fileDirname}, ${env:NAME} …), pythonImagePreview.keepHistory (every preview in its own tab for side-by-side comparison), pythonImagePreview.clearOnSessionEnd, pythonImagePreview.openBeside; changes apply without reload

Beta (0.0.1 – 0.1.2)

  • Supported libraries: NumPy, Pillow, OpenCV, Matplotlib (including pyplot figures), Seaborn, Plotly (kaleido required), ImageIO, scikit-image, TensorFlow, PyTorch (including CUDA tensors)
  • Preview of self.<attribute> members
  • Multi-thread debug sessions
  • Auto import of required modules inside the debuggee