I need to resize pixel art styled X11 cursor files
- User
I need to resize pixel art styled X11 cursor files
Assistant
To resize X11 cursor files while preserving their pixel art style, you have several options depending on the cursor format:
For XCursor (.xcur) files:
Using xcursorgen and ImageMagick:
-
First extract the cursor images:
xcur2png cursor.xcurThis creates PNG files for each size/frame.
-
Resize the PNGs using nearest-neighbor interpolation to preserve pixel art:
convert cursor_32x32.png -filter point -resize 64x64 cursor_64x64.png -
Create a new cursor config file (cursor.conf):
64 0 0 cursor_64x64.pngFormat:
size hotspot_x hotspot_y filename -
Generate the new cursor:
xcursorgen cursor.conf new_cursor.xcur
For XBM (X BitMap) files:
XBM files are text-based, so you can:
- Use ImageMagick:
convert cursor.xbm -filter point -resize 32x32 cursor_32.xbm - Or edit them with any image editor that supports XBM
Batch processing script example:
#!/bin/bash # Resize all cursors in a directory by 2x for file in *.xcur; do mkdir -p "${file%.xcur}_extracted" cd "${file%.xcur}_extracted" xcur2png "../$file" for png in *.png; do size=$(identify -format "%wx%h" "$png") width=${size%x*} height=${size#*x} new_width=$((width * 2)) new_height=$((height * 2)) convert "$png" -filter point -resize ${new_width}x${new_height} "../resized_$png" done cd .. doneImportant considerations:
- Hotspot scaling: Remember to adjust the hotspot coordinates proportionally when resizing
- Multiple sizes: X11 cursors often contain multiple sizes; you may want to resize all of them
- Pixel-perfect scaling: Use integer scaling factors (2x, 3x, 4x) for best results with pixel art
- Alternative tools: GIMP can also edit X11 cursors directly if you prefer a GUI approach
Would you like help with a specific cursor format or scaling factor?
-
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.