```ruby
module Compass::Magick::Commands::Filters
  class Grayscale < Compass::Magick::Command
    def invoke(image)
      image.quantize(256, Magick::GRAYColorspace, Magick::NoDitherMethod)
    end
  end
end
```

Use Magick::modulate instead of Magick::quantize as the latter has issues with transparent PNGs.
user
```ruby
module Compass::Magick::Commands::Filters
  class Grayscale < Compass::Magick::Command
    def invoke(image)
      image.modulate(1.0, 0.0, 1.0)
    end
  end
end
```
assistant