A Java-based self-portrait application built using Java 2D graphics with advanced rendering techniques. The project demonstrates various computer graphics concepts through a detailed portrait drawing with 27 distinct modules.
A Java-based self-portrait application built using Java 2D graphics with advanced rendering techniques. The project demonstrates various computer graphics concepts through a detailed portrait drawing with 27 distinct modules (A-AI).
- Vector Graphics: All shapes created using GeneralPath with lines and curves
- Layered Rendering: Components drawn in specific order for proper overlapping
- Responsive Design: Automatic scaling and centering for any window size
- Transparency Effects: Alpha blending for lenses and texture overlays
- Gradient Fills: Radial and linear gradients for realistic shading
- Anti-aliasing: Enabled for smooth edges on all shapes
- Rendering Hints: Quality settings for optimal graphics output
- Clipping: Viewport restriction to improve rendering efficiency
- Transform Optimization: Single AffineTransform for scaling and translation
javac -d build src/CSEgraphics/InventadoCF_ProjectPrelims.java
java -cp build CSEgraphics.InventadoCF_ProjectPrelims- Implementation:
g2d.setClip(0, 0, 1000, 1000) - Purpose: Restricts drawing to a 1000x1000 pixel region
- Technical Aspect: Viewport management and boundary control
- Anti-aliasing:
RenderingHints.KEY_ANTIALIASING - Text Rendering:
RenderingHints.KEY_TEXT_ANTIALIASING - Quality Settings:
RenderingHints.KEY_RENDERINGwithVALUE_RENDER_QUALITY - Purpose: Smooth edges and high-quality graphics output
- Implementation: AffineTransform with scaling and translation
- Features: Aspect ratio preservation and center alignment
- Technical Aspect: Coordinate transformation and responsive design
- Radial Gradient:
RadialGradientPaintwith white-to-red transition - Texture Overlay: Japanese paper texture using AlphaComposite
- Technical Aspect: Gradient painting and transparency effects
- Module E - Neck Robe: Navy blue kimono collar with curved lines
- Module F - Hair: Complex black-filled GeneralPath with intricate curves
- Module G - Neck: Warm beige skin tone with smooth curves
- Module H - Left Robe Outline: Straight line construction on outer left side of kimono
- Module I - Left Middle Robe: Combination of lines and curves on inner left side of kimono
- Module J - Right Middle Robe: Combination of lines and curves on inner right side of kimono
- Module K - Right Robe Outline: Combination of lines and curves on outer right side of kimono
- Module L - Outer Ears: Detailed ear structure outline with skin tone fill
- Module M - Inner Ears: Fine inner ear details
- Module N - Left Glasses Handle: Pale beige temple piece left
- Module O - Face: Primary facial structure excluding features
- Module P - Right Glasses Handle: Pale beige temple piece right
- Module Q - Left Eyebrow: Black-line curved shape on top of left eyelid
- Module R - Right Eyebrow: Black-line curved shape on top of right eyelid
- Module S - Mouth: Rotated lip shape using AffineTransform (-3 degrees)
- Module T - Left Eye: White-filled eye structure left eye
- Module U - Left Eyelid: Left eye lid curve on top of left eye
- Module V - Left Pupil: Black pupil with white highlight on eye (Module V2)
- Module W - Right Eye: White-filled eye structure right eye
- Module X - Right Eyelid: Right eye lid curve on top of right eye
- Module Y - Right Pupil: Black pupil with white highlight on eye (Module Y2)
- Module Z - Nose: Curved nose structure
- Module AA - Left Nostril: Detailed nose hole left
- Module AB - Right Nostril: Detailed nose hole right
- Module AC - Rim: Main glasses frame structure
- Module AD - Left Lens: Curved lens boundary left and the area was later transparent on module AG
- Module AE - Nose Pad: Pale beige bridge support
- Module AF - Right Lens: Curved lens boundary right and the area was transparent on module AG
- Module AG - Lens Transparency: Area operations with AlphaComposite for 45% opaque lenses
- Module AH - Name and Section: White Arial italic text display name and section
- Module AI - JFrame Setup: Main application window configuration using JPanel
- Skin:
new Color(240, 190, 150)- Warm beige - Robe:
new Color(30, 40, 60)- Navy blue - Glasses Frame:
new Color(230, 210, 190)- Pale beige - Mouth:
new Color(255, 102, 102)- Light red - Background: Radial white-to-red gradient
- Hair/Eyebrows:
Color.BLACK - Eyes:
Color.WHITEwithColor.BLACKpupils
- Thick Outlines: 10.0f (Face, Neck, Robe)
- Medium Outlines: 5.0f (Hair, Glasses, Handles)
- Fine Details: 3.0f (Eyes, Nose, Ears, Mouth)
- Base Design: 1000x1000 pixels
- Scaling: Proportional scaling maintaining aspect ratio
- Centering: Automatic centering within container
- GeneralPath: Extensive use for all custom shapes with moveTo, lineTo, and curveTo operations
- Ellipse2D: Circular pupils with white highlights
- Area Operations: Complex shape combinations for transparent lenses
- AffineTransform: Rotation applied to mouth (-3 degrees)
- Scaling: Dynamic resizing while maintaining proportions
- Translation: Automatic centering of portrait
- AlphaComposite: 45% opacity for glasses lenses
- Texture Overlay: Japanese paper effect with random dot pattern
- Gradient Fills: Radial background with smooth color transitions
- A 1000x1000 window titled "Inventado, Charles Fredric G. // Self-Portrait"
- Scalable self-portrait with red radial background and paper texture
- Detailed facial features with transparent eyeglasses
- Navy blue kimono/robe with proper layering
- Name "Inventado, Charles Fredric G." and section "4CSE" displayed in top-left
- Portrait maintains proportions when window is resized
Developer: Charles Fredric G. Inventado
Course: CS-26115 Graphics Computing and Multimedia Technology
Section: 4CSE
The project demonstrates comprehensive understanding of Java 2D graphics, including shape manipulation, color gradients, transparency effects, coordinate transformations, and responsive rendering across 27 integrated modules.