Apple has been accused of misrepresenting its iOS 8 operating system upgrade by using an "unexpectedly large percentage" of storage on 8- and 16-gigabyte devices, resulting in a class-action lawsuit against the iPhone maker.

The complaint was filed in a California court on Tuesday on behalf of plaintiffs Paul Orshan and Christopher Endara. The suit alleges that Apple failed to disclose to consumers that as much as 23.1 percent of the advertised storage capacity of an iPhone, iPad or iPod touch would be consumed by iOS 8 once the upgrade is installed.

The suit alleges that "reasonable consumers" would not expect such a discrepancy after updating their device to the latest operating system. By their calculations, each gigabyte of capacity removed from an "iDevice" equates to as many as 500 high-resolution photographs.

Going one step further, the complaint accuses Apple of using this limited capacity to sell users on iCloud storage upgrades. The suit claims that Apple's "sharp business tactics" can take advantage of consumers in a "desperate moment," such as when they're "trying to record or take photos at a child or grandchild's recital, basketball game or wedding."

The class-action lawsuit states that Orshan owned two iPhone 5s units, as well as two iPads, all with 16 gigabytes of storage that were upgraded to iOS 8. Endara is also said to own a 16-gigabyte iPhone 6 that came with iOS 8 preinstalled.

The plaintiffs allege that Apple is engaged in "false, deceptive and misleading practices" in marketing its iPhone, iPad and iPod touch devices. They have taken issue with the fact that a 16-gigabyte iPhone, even when purchased new with iOS 8 preinstalled, does not actually have 16 gigabytes of usable storage.