High-concurrency image transcoding for Java & Spring Boot
Production-ready Java client engineered for Spring Boot, Quarkus, and Micronaut microservices. High throughput with non-blocking I/O.
Install
$ implementation "app.smallpict:smallpict-java:1.2.0"Implementation example
// Spring Boot Service Example
import app.smallpict.SmallPictClient;
import app.smallpict.models.OptimizeRequest;
import app.smallpict.models.ImageFormat;
import org.springframework.stereotype.Service;
@Service
public class MediaOptimizationService {
private final SmallPictClient client = new SmallPictClient(System.getenv("SMALLPICT_API_KEY"));
public String optimizeUpload(byte[] imageBytes) {
return client.optimize(OptimizeRequest.builder()
.bytes(imageBytes)
.format(ImageFormat.AVIF)
.quality(80)
.maxWidth(1600)
.build())
.getCdnUrl();
}
}Integration steps
Add Maven / Gradle dependency
Add app.smallpict:smallpict-java to your build.gradle or pom.xml.
Register Spring Bean
Define SmallPictClient @Bean with connection pooling and timeouts.
Process byte streams
Pass InputStream or byte[] buffers directly into client.optimize().
Key benefits
- Thread-safe client with OkHttp connection pooling and HTTP/2
- Built-in exponential backoff and circuit breaker support
- Streams uploads with no local disk writes
- Compatible with Java 17, 21 LTS and Spring Boot 3+
Need complete implementation guides & API specs?
Explore parameter references, authentication mechanisms, error codes, and local testing instructions in our official Java & Spring Boot SDK developer guide.
Read Java & Spring Boot SDK DocsSpeed Up Your Java & Spring Boot SDK Image Pipeline
Try AVIF and WebP image optimization in your application. No setup fee, and sandbox keys right away.