SmallPict LogoSmallPict
Official Integration & SDK

Effortless Image Processing for Ruby on Rails & ActiveStorage

Accelerate Rails image uploads with our official gem. Seamlessly complements ActiveStorage variants and Sidekiq background jobs.

Install:gem install smallpict-ruby
RUBY Package

Implementation Example

ruby
# Gemfile
gem 'smallpict-ruby'

# config/initializers/smallpict.rb
SmallPict.configure do |config|
  config.api_key = ENV['SMALLPICT_API_KEY']
  config.auto_format = :auto # Selects AVIF or WebP based on client
  config.quality = 82
end

# In your Controller / Service:
optimized_url = SmallPict.optimize(
  user.avatar.url,
  width: 400,
  format: :avif
)

Integration Steps

11. Add gem to Gemfile

Add gem 'smallpict' to your Gemfile and run bundle install.

22. Configure Initializer

Create config/initializers/smallpict.rb with your API key and default format.

33. Process Attachments

Use smallpict_optimize on ActiveStorage attachments before persisting to cloud.

Key Benefits

  • Native ActiveStorage integration with zero friction
  • Sidekiq and GoodJob background worker adapters
  • Automatic fallback handling during network blips
  • Preserves original master files alongside modern formats
Official Developer Documentation

Need Complete Implementation Guides & API Specs?

Explore parameter references, authentication mechanisms, error codes, and local testing instructions in our official Ruby & Rails Gem developer guide.

Read Ruby & Rails Gem Docs

Supercharge Your Ruby & Rails Gem Image Pipeline

Experience sub-50ms AVIF and WebP image optimization in your application. Zero setup fee, instant sandbox keys, and unlimited scalability.