Resizing pixel art X11 cursor files requires careful handling to maintain the sharp, blocky aesthetic of pixel art. Here’s a step-by-step guide to help you resize them properly:
1. Understand the File Format
X11 cursor files typically use the .Xcursor format (a collection of PNG images with metadata). You can extract and modify these images before repackaging them.
2. Tools You’ll Need
xcursorgen (to compile cursor files)
- Image editor (e.g., GIMP, Aseprite, or Photoshop with pixel art plugins)
- Command-line tools (for extraction and conversion)
3. Extract the Cursor Images
If you have an .Xcursor file, you can extract its frames using:
xcursorgen --preview cursor_file.cursor -o extracted_frames
Alternatively, manually open the file in a hex editor or use a tool like xcursor2png to extract PNG frames.
4. Resize the Pixel Art Properly
When resizing pixel art, avoid standard interpolation (like bilinear or bicubic), as it blurs edges. Instead:
- Use Nearest-Neighbor scaling (preserves sharp pixels).
- Resize in integer multiples (e.g., 2x, 3x) to avoid distortion.
- Manually touch up any artifacts in a pixel art editor.
In GIMP:
- Open the cursor image.
- Go to Image → Scale Image.
- Set Interpolation to None (Nearest Neighbor).
- Adjust dimensions (preferably in multiples of the original size).
- Export as PNG.
In Aseprite:
- Open the image.
- Use Image → Scale and select Nearest Neighbor.
- Adjust dimensions and save.
5. Rebuild the X11 Cursor File
After resizing all frames, repack them into an .Xcursor file:
- Create a
.cursor configuration file (e.g., my_cursor.cursor) with metadata.
- Use
xcursorgen to compile:
xcursorgen my_cursor.cursor output_cursor
6. Test the Cursor
Apply the cursor in your X11 environment to verify it looks correct:
xsetroot -cursor_name output_cursor
Alternative: Use Pre-Made Tools
xcursor-scaler (a script to automate scaling Xcursor files).
- Online pixel art scalers (like Pixel Art Scaler).
Final Notes
- Backup original files before modifying.
- Test at different sizes to ensure clarity.
- Consider manual touch-ups if scaling introduces artifacts.
Would you like help with a specific part of this process?