Scan a fruit or vegetable and get an instant visual-quality read: freshness classification, damaged-area highlighting, shelf-life estimate, grading, and a suggested market for the produce.
Turn your phone's flashlight on, hold it close to the same spot on the fruit (10–15cm), and snap a second photo. This checks for an artificial wax/coating layer by how the flash glare reflects off the skin — it does not detect chemicals or residue.
The image is sampled pixel-by-pixel and converted from RGB to HSV color space. Background pixels (plain, low-saturation, bright — like a table or counter) are excluded. Among the remaining "produce" pixels, the app finds the dominant hue — the produce's characteristic healthy color — then flags a pixel as a defect if it is:
The percentage of flagged pixels becomes the "affected area." Grading (A/B/C) is a proxy based on this defect percentage and color consistency — it is not official USDA-style grading, which also weighs size and weight against a physical reference scale that a single photo can't provide. Shelf-life is a rough heuristic (typical days-to-spoilage for that produce type, scaled down by how much damage is already visible), not a lab-measured decay curve.
Torch/glare coating check (optional): when a flash-lit photo is provided, the app finds very bright, low-saturation "glare" pixels and measures two things: how much of the produce area they cover, and how smooth/contiguous the biggest glare blob is versus scattered into many small specks. Waxed or artificially coated produce tends to reflect flash light as one large, smooth, mirror-like patch because the coating fills in the skin's natural micro-texture. Unwaxed skin scatters the flash into many small, irregular highlights because of natural pores, ridges, and matte texture. This is a visual glossiness proxy for surface coating — it cannot identify what any coating or residue is made of, and it is not a pesticide/fertilizer/chemical test. A "High" reading means "this surface looks synthetically glossy," not "this fruit is unsafe."