- Robotgo version (or commit ref): v0.110.8
- Go version: go1.24.4 darwin/arm64
- Gcc version: Apple clang version 16.0.0 (clang-1600.0.26.6)
- Operating system and bit: macOS 15.4.1
- Resolution: 2056x1329
- Can you reproduce the bug at Examples:
- Provide example code:
package main
import (
"github.com/go-vgo/robotgo"
)
func main() {
robotgo.CaptureImg()
}
❯ time go run main.go
go run main.go 0.96s user 0.95s system 12% cpu 15.653 total
Description
Just a CaptureImg call took 15s in my device. I'm not sure if it performs similarly on other OS.
I think the syscall with bitmap spend too much time.
Python's pillow library uses the subprocess method instead of syscall. It has great performance. I think we can refer to their implementation.
https://github.com/python-pillow/Pillow/blob/222b86222ea005936089a7086da24c95bc6cc3db/src/PIL/ImageGrab.py#L33-L116
❯ time go run main.go go run main.go 0.96s user 0.95s system 12% cpu 15.653 totalDescription
Just a
CaptureImgcall took 15s in my device. I'm not sure if it performs similarly on other OS.I think the syscall with bitmap spend too much time.
Python's pillow library uses the subprocess method instead of syscall. It has great performance. I think we can refer to their implementation.
https://github.com/python-pillow/Pillow/blob/222b86222ea005936089a7086da24c95bc6cc3db/src/PIL/ImageGrab.py#L33-L116