Skip to content

Repository files navigation

Inventado Self-Portrait Graphics Output

Inventado Self-Portrait

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.

Java Java 2D Swing / AWT Course CS-26115

Inventado Self-Portrait

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).

Module Implementation Details

Key Technical Features

  • 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

Performance Optimizations

  • 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

Compilation and Execution

Command Line Compilation

javac -d build src/CSEgraphics/InventadoCF_ProjectPrelims.java
java -cp build CSEgraphics.InventadoCF_ProjectPrelims

Technical Overview

Core Graphics Modules

Module A - Clipping

  • Implementation: g2d.setClip(0, 0, 1000, 1000)
  • Purpose: Restricts drawing to a 1000x1000 pixel region
  • Technical Aspect: Viewport management and boundary control

Module B - Rendering Optimization

  • Anti-aliasing: RenderingHints.KEY_ANTIALIASING
  • Text Rendering: RenderingHints.KEY_TEXT_ANTIALIASING
  • Quality Settings: RenderingHints.KEY_RENDERING with VALUE_RENDER_QUALITY
  • Purpose: Smooth edges and high-quality graphics output

Module C - Dynamic Resizing

  • Implementation: AffineTransform with scaling and translation
  • Features: Aspect ratio preservation and center alignment
  • Technical Aspect: Coordinate transformation and responsive design

Module D - Background Effects

  • Radial Gradient: RadialGradientPaint with white-to-red transition
  • Texture Overlay: Japanese paper texture using AlphaComposite
  • Technical Aspect: Gradient painting and transparency effects

Portrait Components (Modules E-AI)

Facial Structure (Modules E-O)

  • 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

Facial Features (Modules P-AB)

  • 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

Eyeglasses System (Modules AC-AG)

  • 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

Text and Display (Modules AH-AI)

  • Module AH - Name and Section: White Arial italic text display name and section
  • Module AI - JFrame Setup: Main application window configuration using JPanel

Technical Specifications

Color Palette

  • 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.WHITE with Color.BLACK pupils

Stroke Widths

  • Thick Outlines: 10.0f (Face, Neck, Robe)
  • Medium Outlines: 5.0f (Hair, Glasses, Handles)
  • Fine Details: 3.0f (Eyes, Nose, Ears, Mouth)

Coordinate System

  • Base Design: 1000x1000 pixels
  • Scaling: Proportional scaling maintaining aspect ratio
  • Centering: Automatic centering within container

Advanced Graphics Techniques

Shape Construction

  • 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

Transformation Effects

  • AffineTransform: Rotation applied to mouth (-3 degrees)
  • Scaling: Dynamic resizing while maintaining proportions
  • Translation: Automatic centering of portrait

Transparency and Compositing

  • AlphaComposite: 45% opacity for glasses lenses
  • Texture Overlay: Japanese paper effect with random dot pattern
  • Gradient Fills: Radial background with smooth color transitions

Expected Output

  • 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

Credits

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.

About

My self-portrait using Java and utilizing Netbeans environment, done with prelim topics learned in CS 26115 - Graphics Computing and Multimedia Technology

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages