Here's Python code using matplotlib to create the overlay diagram with all the sensor sizes and outputs:
import matplotlib.pyplot as plt
import matplotlib.patches as patches
from matplotlib.patches import Rectangle
# Define the dimensions and colors
rectangles = [
{"name": "Full Frame Sensor", "width": 6192, "height": 4128, "color": "black", "alpha": 0.3},
{"name": "APS-C Sensor", "width": 4660, "height": 3100, "color": "red", "alpha": 0.3},
{"name": "APS-C RAW Output", "width": 4672, "height": 2628, "color": "blue", "alpha": 0.3},
{"name": "Full Frame RAW Output", "width": 4264, "height": 2408, "color": "violet", "alpha": 0.3},
{"name": "DCI 4K", "width": 4096, "height": 2160, "color": "yellow", "alpha": 0.4},
{"name": "UHD 4K", "width": 3840, "height": 2160, "color": "green", "alpha": 0.4}
]
# Create figure and axis
fig, ax = plt.subplots(1, 1, figsize=(14, 10))
# Find the maximum dimensions for centering
max_width = max(rect["width"] for rect in rectangles)
max_height = max(rect["height"] for rect in rectangles)
# Draw rectangles from largest to smallest
for rect_info in rectangles:
width = rect_info["width"]
height = rect_info["height"]
# Calculate center position
x = (max_width - width) / 2
y = (max_height - height) / 2
# Create rectangle
rect = Rectangle((x, y), width, height,
linewidth=2,
edgecolor=rect_info["color"],
facecolor=rect_info["color"],
alpha=rect_info["alpha"],
label=f'{rect_info["name"]} ({width}×{height})')
# Add rectangle to plot
ax.add_patch(rect)
# Add text label in the center of each rectangle
ax.text(x + width/2, y + height/2,
f'{rect_info["name"]}\n{width}×{height}',
ha='center', va='center',
fontsize=10, fontweight='bold',
color='white' if rect_info["color"] in ["black", "blue", "red"] else 'black',
bbox=dict(boxstyle="round,pad=0.3", facecolor=rect_info["color"], alpha=0.7))
# Set axis properties
ax.set_xlim(-100, max_width + 100)
ax.set_ylim(-100, max_height + 100)
ax.set_aspect('equal')
ax.grid(True, alpha=0.3)
# Add title and labels
plt.title('Sensor and Output Resolution Comparison', fontsize=16, fontweight='bold', pad=20)
plt.xlabel('Width (pixels)', fontsize=12)
plt.ylabel('Height (pixels)', fontsize=12)
# Create custom legend
legend_elements = [patches.Patch(facecolor=rect["color"],
edgecolor=rect["color"],
label=f'{rect["name"]} ({rect["width"]}×{rect["height"]})')
for rect in rectangles]
ax.legend(handles=legend_elements, loc='upper right', bbox_to_anchor=(1.15, 1),
frameon=True, fancybox=True, shadow=True)
# Adjust layout to prevent legend cutoff
plt.tight_layout()
# Show the plot
plt.show()
# Optional: Save the figure
# plt.savefig('sensor_resolution_overlay.png', dpi=300, bbox_inches='tight')
This code creates a centered overlay diagram where:
- Black = Full Frame Sensor (6192×4128)
- Violet = Full Frame RAW Output (4264×2408)
- Red = APS-C Sensor (4660×3100)
- Blue = APS-C RAW Output (4672×2628)
- Yellow = DCI 4K (4096×2160)
- Green = UHD 4K (3840×2160)
The rectangles are semi-transparent so you can see how they overlap. Each rectangle is labeled with its name and dimensions. The legend on the right shows all the formats with their colors and sizes.
To run this code, you'll need to have matplotlib installed:
pip install matplotlib
The diagram clearly shows the relative sizes of each format, with all rectangles center-aligned for easy comparison. You can uncomment the last line to save the diagram as a high-resolution PNG file.