The remaining stock featured promising customer design-ins and long product lifecycles that lay the groundwork for a more stable outlook in 2024. Gross margin in 2023 was 27.9%, decreasing from 40.5% in 2022. As a reminder, in Q2, we strategically terminated high cost foundry capacity agreements, leading to a depressed Q2 gross margin of just 21.7%. Despite the temporary margin contraction, this decision liberates new wafer start from minimum fulfillment constraints, while positioning us to capitalize on the turnaround in demand. Operating expenses in 2023 were $220.3 million, a decline of 4% from 2022, primarily a result of the lower vested portion of the annual bonus compensation awarded to employee in 2023 and the preceding years, partially offset by increased salary and R&D expenses.
2023 operating income was $43.2 million, or 4.6% of sales, a decrease from $257.6 million, or 21.4% of sales in 2022. Our net profit for 2023 was $50.6 million, or $0.29 diluted ADS, as compared to $237 million or $1.36 per diluted ADS in 2022. Turning to the balance sheet, we had $206.4 million of cash, cash equivalents and other financial assets as of December 31, 2023. This compares to $229.9 million at the same time last year and $155.4 million a quarter ago. We achieved a strong positive operating cash flow of $68.7 million for the fourth quarter as a result of substantial reduction in the inventory across major product lines. As of December 31, 2023, we had $40.5 million in long term unsecured loans with $6 million representing the current portion.
Our year-end inventories were $217.3 million, lower than $259.6 million last quarter and $370.9 million at the end of last year. Our inventory level has declined steadily over the last five quarters and reached a healthy level by end of 2023. Accounts receivable at the end of December 2023 was $235.8 million, a decline from $248.5 million last quarter and down from $261.1 million a year ago. DSO was 91 days at the quarter end as compared to 95 days last quarter and 79 days a year ago. Fourth quarter capital expenditures were $15.1 million versus $2.6 million last quarter and $2.3 million a year ago. Fourth quarter CapEx was mainly allocated to in house testers for our IC design business in addition to other R&D related equipment. Total capital expenditures for 2023 was $23.4 million, as compared to $11.8 million in 2022.
As of December 31, 2023, Himax has $174.7, million ADS outstanding unchanged from last quarter. On a fully diluted basis, the total number of ads outstanding for the fourth quarter was $175 million. Now turning to our first quarter 2024 guidance. We expect first-quarter revenues to decline 9% to 16% sequentially. Gross margin is expected to be around 28.5% depending on the final product mix. The first quarter profit attributable to shareholders is estimated to be in the range of $0.02 to $0.05 for fully diluted ADS. I will now turn the call over to Jordan to discuss our Q1 outlook. Jordan, the floor is yours.
Jordan Wu: Traditionally, business operations in the first quarter decelerate due to the Lunar New Year holidays. This year, exacerbated conditions due to sluggish demand are causing panel makers to strategically lower factory utilizations, in an attempt to support panel pricing and profitability. In tandem, OEMs and end customers are maintaining their cautious approach with heightened procurement scrutiny, even with inventories now at more manageable levels, this shift has resulted in short-term forecast and more frequent last-minute orders, ultimately constraining our visibility, particularly in consumer electronics products. To fortify the resilience of our operations, we are actively implementing strategies to optimize costs and diversify suppliers in both foundries and backend sources to enhance supply flexibility and cost-effectiveness.
The recent partnership with Nexchip for the automotive market illustrated our supplier diversification strategy. It also highlighted our strategic approach to better align with customers’ regional supply policies, particularly addressing the surging demand in China’s automotive industry. In addition, our recent presence at the CES provided a comprehensive outlook on our strategic focus for the upcoming years, covering automotive, WiseEye AI and optical technologies. In automotive, our primary revenue contributor, we remain as optimistic as ever, given our extensive, unparalleled product portfolio across a broad spectrum of technologies, from mainstream LCD technology to the emerging OLED technology. Notably, within the automotive LCD display sector, we have secured 100s of design wins in TDDI and local dimming Tcon and continue to see ongoing expansion in our pipeline.
The majority of these design wins are slated for mass production in the next two years, underscoring our continued market dominance moving forward. Furthermore, our expansion into automotive OLED displays covering all of DDIC, Tcon, and touch controller bolsters our market share leadership by offering customers an integrated bundle solution. As a reminder, our automotive driver business represented 36% of our total sales in the full-year 2023, and we anticipated will expand to well over 40% of our total sales in 2024. In the AI domain, we are relentlessly dedicated to our WiseEye product line, where we have already achieved industry-leading ultralow power consumption and AI inference performance. Our shipment with WiseEye is also now further supported through strategic collaborations with ecosystem partners and system integration companies covering a broad range of AI applications.
Concurrently, we are actively expanding our easy to adopt WiseEye module offering for the endpoint AI market to cater to its diverse needs and capitalize on the extensive opportunities in endpoint AI. Looking further out on the horizon while the realization of LCoS may span several years, the ultra-illuminance color sequential front-lit LCoS microdisplay that we unveiled at the CES marked a major technology breakthrough that we believe will pave the way for the realization of true see-through AR goggles. In summary, driven by accelerating growth in our automotive segment and expansion beyond our core driver business, we are well positioned for sustainable long-term revenue growth and profitability. Furthermore, our automotive WiseEye and LCoS product lines have attracted a strong global client base, which significantly extends our reach and strengthens our presence in markets worldwide, while diversifying regional exposure and adding stability to our operations.